/usr/include/falcon/memory.h is in falconpl-dev 0.9.6.9-git20120606-2.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | /*
FALCON - The Falcon Programming Language.
FILE: flc_memory.h
User overridable basic memory allocation
-------------------------------------------------------------------
Author: Giancarlo Niccolai
Begin: mar ago 3 2004
-------------------------------------------------------------------
(C) Copyright 2004: the FALCON developers (see list in AUTHORS file)
See LICENSE file for licensing details.
*/
#ifndef flc_MEMORY_H
#define flc_MEMORY_H
#include <falcon/setup.h>
#include <falcon/globals.h>
#include <stdlib.h>
/** \file
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.
*/
namespace Falcon {
/** Account allocated memory.
Allocators creating Falcon object should call this function to inform the GC system
of the memory they are consuming, and so, the memory that may be freed if they are
reclaimed.
Global functions Falcon::gcAlloc(), Falcon::gcRealloc() and Falcon::gcFree() call automatically this
account function. Garbageable objects are derived by a base class that automatically calls this
functions.
*/
FALCON_DYN_SYM void gcMemAccount( size_t memSize );
FALCON_DYN_SYM void gcMemUnaccount( size_t memSize );
/** Call once Falcon is shut down. */
FALCON_DYN_SYM void gcMemShutdown();
/** Return the total memory allocated by the GC system. */
FALCON_DYN_SYM size_t gcMemAllocated();
FALCON_DYN_SYM void * DflMemAlloc( size_t amount );
FALCON_DYN_SYM void DflMemFree( void *mem );
FALCON_DYN_SYM void * DflMemRealloc( void *mem, size_t amount );
FALCON_DYN_SYM void * DflAccountMemAlloc( size_t amount );
FALCON_DYN_SYM void DflAccountMemFree( void *mem );
FALCON_DYN_SYM void * DflAccountMemRealloc( void *mem, size_t amount );
}
#endif
/* end of flc_memory.h */
|