Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > media > contrib > by-pkgid > 04e5d8c10ae76748689b4e7f48e0fa33 > files > 4085

libogre5-devel-1.0.0-1mdk.i586.rpm

<html>
<head>
<title>The memory manager information page - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<link type="text/css" rel="stylesheet" href="style.css">
</head>

<body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1><a class="anchor" name="memory_manager">The memory manager information page</a></h1>The memory manager is a class that handles memory (de)allocation requests. <dl compact><dt><b></b></dt><dd>This class works like a wrapper between the actual C memory allocation functions (*alloc, free) and the memory (de)allocation requests of the application. </dd></dl>
<dl compact><dt><b></b></dt><dd>Why would such a class be needed? First of all, because we had some major issues with memory getting misued (read: deleted) over DLL boundaries. One thing this memory manager does is solve the problem by allocating all the memory in the OgreMain.dll/so process. </dd></dl>
<dl compact><dt><b></b></dt><dd>Another use would be leak detection and memory misuse detection. With a custom memory manager, calls to new/delete and *alloc/free could be overseed and logged. </dd></dl>
<dl compact><dt><b></b></dt><dd>Yet another use is the optimization of memory allocation for certain object types. One of the most common examples is a small object allocator. </dd></dl>
<p>
There actually are two classes, one is the standard memory manager which only addresses memory allocation problems when deallocating across processes. <dl compact><dt><b></b></dt><dd>The other is a modified version of the debugging memory manager written by Paul 'MidNight' Nettle (aka. the Fluid Studios Memory Manager). Obviously, the second one should be used only when debugging your application as it adds some visible overhead. </dd></dl>
<dl compact><dt><b></b></dt><dd>You can switch between the two memory managers by setting the value of the OGRE_DEBUG_MEMORY_MANAGER macro in <a class="el" href="OgreConfig_8h.html">OgreConfig.h</a> </dd></dl>
<p>
The class contains a static member of type <a class="el" href="classOgre_1_1MemoryManager.html">MemoryManager</a>. That is because we want the memory manager to be created even before we override the new([])/delete([]) operators. <p>
<a href="http://www.flipcode.com/cgi-bin/msg.cgi?showThread=12September2000-PresentingAMemoryManager&forum=askmid&id=-1">Paul Nettle's Memory Manager page at flipCode</a> - you can get the original source form here. <p>
Copyright &copy; 2000-2005 by The OGRE Team<br />
Last modified Wed Feb 23 00:19:23 2005
</p>
</body>
</html>