File: ttmemory.xml

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (150 lines) | stat: -rw-r--r-- 3,281 bytes parent folder | download | duplicates (3)
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
150
<?xml version="1.0" encoding="UTF-8"?>
<fpdoc-descriptions>
<package name="freetypelaz">
<!--
====================================================================
TTMemory
====================================================================
-->
<module name="TTMemory">
<short>Memory management specification.</short>
<descr>
<p>
Copyright 1996 David Turner, Robert Wilhelm and Werner Lemberg.
</p>
<p>
<file>ttmemory.pas</file> is part of the FreeType project, and may only be 
used modified and distributed under the terms of the FreeType project license, 
LICENSE.TXT. By continuing to use, modify or distribute this file you indicate 
that you have read the license and understand and accept it fully.
</p>
<p>
Differences between 2.1 and 2.0:
</p>
<ul>
<li>Added a memory mutex to make the component thread-safe.</li>
</ul>
<p>
Differences between 2.0 and 1.1:
</p>
<ul>
<li>The growing heap was completely removed in version 2.0,</li>
<li>
The support for small mini-heaps may be re-introduced later to allow the 
storage of several consecutive arrays in one single block.
</li>
</ul>
<remark>
<p>IMPORTANT NOTICE :</p>
<p>
The Alloc and Free functions mimic their C equivalent, however, some points 
must be noticed:
</p>
<ul>
<li>
Both functions return a boolean. As usual, <b>True</b> indicates success, 
while <b>False</b> indicates failure.
</li>
<li>
The Alloc function puts a small header on front of each allocated block. The 
header contains a magic cookie and the size of the allocated block. This 
allows calls to Free without passing a block size as an argument, and thus 
reduces the risks of memory leaks.
</li>
<li>
It is possible to call Free with a nil pointer, in which case nothing happens, 
and the result is set to <b>True</b> (success).
</li>
</ul>
<p>
The pointer is set to nil after a call to Free in all cases.
This is done to clear the destructors code, allowing:
</p>
<code>
if (pointer) then
begin
  Free(pointer);
  pointer := nil;
end;
</code>
<p>To be replaced by a single line:</p>
<code>
Free(pointer);
</code>
</remark>
</descr>

<!-- unresolved external references -->
<element name="TTTypes"/>

<element name="TMarkRecord">
<short/>
<descr/>
<seealso/>
</element>
<element name="TMarkRecord.Magic">
<short/>
</element>
<element name="TMarkRecord.Top">
<short/>
</element>

<element name="Font_Pool_Allocated">
<short/>
<descr/>
<seealso/>
</element>

<element name="Alloc">
<short/>
<descr>
<p>
Allocates a new memory block in the current heap of <var>size</var> bytes. 
Returns failure if no memory is left in the heap.
</p>
</descr>
<seealso/>
</element>
<element name="Alloc.Result">
<short/>
</element>
<element name="Alloc.P">
<short/>
</element>
<element name="Alloc.size">
<short/>
</element>

<element name="Free">
<short/>
<descr>
<p>
Releases a block previously allocated through <var>Alloc</var>. Returns 
<b>True</b> (success) if P is Nil before the call. Sets P to nil before exit.
</p>
</descr>
<seealso/>
</element>
<element name="Free.P">
<short/>
</element>

<element name="TTMemory_Init">
<short/>
<descr/>
<seealso/>
</element>
<element name="TTMemory_Init.Result">
<short/>
</element>

<element name="TTMemory_Done">
<short/>
<descr/>
<seealso/>
</element>

</module>
<!-- TTMemory -->
</package>
</fpdoc-descriptions>