/home/gian/Progetti/falcon/core/include/falcon/memory.h File Reference

This files contains the user overridable memory allocation systems. More...

#include <falcon/setup.h>
#include <falcon/globals.h>
#include <stdlib.h>

Include dependency graph for memory.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Namespaces

namespace  Falcon
 CONST.

Functions

FALCON_DYN_SYM void * Falcon::DflAccountMemAlloc (size_t amount)
FALCON_DYN_SYM void Falcon::DflAccountMemFree (void *mem)
FALCON_DYN_SYM void * Falcon::DflAccountMemRealloc (void *mem, size_t amount)
FALCON_DYN_SYM void * Falcon::DflMemAlloc (size_t amount)
FALCON_DYN_SYM void Falcon::DflMemFree (void *mem)
FALCON_DYN_SYM void * Falcon::DflMemRealloc (void *mem, size_t amount)
FALCON_DYN_SYM void Falcon::gcMemAccount (size_t memSize)
 Account allocated memory.
FALCON_DYN_SYM size_t Falcon::gcMemAllocated ()
 Return the total memory allocated by the GC system.
FALCON_DYN_SYM void Falcon::gcMemShutdown ()
 Call once Falcon is shut down.
FALCON_DYN_SYM void Falcon::gcMemUnaccount (size_t memSize)


Detailed Description

This files contains the user overridable memory allocation systems.

Memory is alwas allocated via memAlloc() and released via memFree() function pointers. These are initially set at DflMemAlloc() and DflMemFree() functions, but they may be overridden with functions of the same kind at every point.

Falcon memory management is twofold: Memory used for internal storage (i.e. module loading, symbol tables, file names, configurations etc) is not accounted nor controlled, and never garbaged; the only control is during allocation and releasing via the basic functions, which print an error message and quit in case of allocation errors.

Items used by the VM (generated by scripts or returned to scripts by extensions) are created via the MemPool object; the memory allocated by this object is stored in the memory pool and may be garbaged, recycled or corrected.

In either case, Falcon never makes any assumption on the given memory. The embedding application may safely add any kind of memory management & accounting it likes.


Generated on Mon Oct 19 10:11:16 2009 for Falcon_Core by  doxygen 1.5.8