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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<package name="rtl">
<!--
====================================================================
cmem
====================================================================
-->
<module name="cmem">
<short>Memory manager replacement using the C memory manager</short>
<descr>
<p>
The <file>cmem</file> 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 <link id="Malloc"/>, <link id="Free"/> and
<link id="ReAlloc"/>. For this reason, the <file>cmem</file> unit should be
the first unit of the uses clause of the program.
</p>
<p>
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.
</p>
<p>
Obviously, including this unit links your program to the C library.
</p>
<remark>
Note that specifying the <var>-gv</var> command-line option, to enable valgrind debugging info will implicitly add this unit to your program.
</remark>
</descr>
<!-- constant Visibility: default -->
<element name="LibName">
<short>Name of the library used</short>
<descr>
<var>LibName</var> is the name of the library that is actually used. On most
systems, this is simply "libc.so".
</descr>
</element>
<!-- function Visibility: default -->
<element name="Malloc">
<short>Malloc external declaration.</short>
<descr>
<var>Malloc</var> is the external declaration of the C libraries
<var>malloc</var> call. It accepts a size parameter, and returns a
pointer to a memory block of the requested size or <var>Nil</var>
if no more memory could be allocated.
</descr>
<seealso>
<link id="Free"/>
<link id="ReAlloc"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="Malloc.Result">
<short>A pointer to the newly allocated memory block</short>
</element>
<!-- argument Visibility: default -->
<element name="Malloc.Size">
<short>Requested size for the new memory block.</short>
</element>
<!-- procedure Visibility: default -->
<element name="Free">
<short>Free a previously allocated block</short>
<descr>
<var>Free</var> returns the memory block pointed to by <var>P</var> to the system. After <var>Free</var>
was called, the pointer <var>P</var> is no longer valid.
</descr>
<seealso>
<link id="Malloc"/>
<link id="ReAlloc"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="Free.P">
<short>Pointer to the memory block to be freed.</short>
</element>
<!-- function Visibility: default -->
<element name="ReAlloc">
<short>Reallocates a memory block</short>
<descr>
<var>ReAlloc</var> re-allocates a block of memory pointed to by
<var>p</var>. The new block will have size <var>Size</var>, and
as much data as was available or as much data as fits is copied from the old
to the new location.
</descr>
<seealso>
<link id="Malloc"/>
<link id="Free"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ReAlloc.Result">
<short>A pointer to the new memory block</short>
</element>
<!-- argument Visibility: default -->
<element name="ReAlloc.P">
<short>Pointer to the old block</short>
</element>
<!-- argument Visibility: default -->
<element name="ReAlloc.Size">
<short>New size for the memory block.</short>
</element>
<!-- function Visibility: default -->
<element name="CAlloc">
<short>Allocate memory based on item size and count</short>
<descr>
<var>Calloc</var> allocates memory to hold <var>UnitCount</var> units of
size <var>UnitSize</var> each. The memory is one block of memory. It returns
a pointer to the newly allocated memory block.
</descr>
<seealso>
<link id="Malloc"/>
<link id="Free"/>
<link id="Realloc"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="CAlloc.Result">
<short>Pointer to the newly allocated memory block.</short>
</element>
<!-- argument Visibility: default -->
<element name="CAlloc.unitSize">
<short>Size of one unit.</short>
</element>
<!-- argument Visibility: default -->
<element name="CAlloc.UnitCount">
<short>Number of units.</short>
</element>
</module> <!-- cmem -->
</package>
</fpdoc-descriptions>
|