cmem unit
Memory manager replacement using the C memory manager.
The cmem memory manager sets the system units memory manager
to a C-based memory manager: all memory management calls are shunted through
to the C memory manager, using Malloc, Free and
ReAlloc. For this reason, the cmem unit should be
the first unit of the uses clause of the program.
The unit also offers the C memory calls directly as external declarations from the C library, but it is recommended to use the normal FPC routines for this.
Obviously, including this unit links your program to the C library.
Note that specifying the
-gv command-line option, to enable valgrind debugging info will implicitly add this unit to your program.
Procedures and functions
CAlloc | function | Allocate memory based on item size and count. |
Free | procedure | Free a previously allocated block. |
Malloc | function | Malloc external declaration. |
ReAlloc | function | Reallocates a memory block. |
Constants
LibName | constant | Name of the library used. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
