6c233a4504f697a067e2ba3b627c6e10f5bef7b4
1 /********************************************************************
3 memory.c - memory handling routines
5 Niksa Orlic, 2005-03-22
7 ********************************************************************/
9 #include <stdlib.h>
10 #include <string.h>
14 //#include "message.h"
16 #define SLOWLIST 1
22 /*
23 Initialize the list of memory objects
24 */
26 {
32 }
34 /*
35 Clean up the list of memory objects
36 */
38 {
43 {
46 #if SLOWLIST
50 #else
52 #endif
53 }
54 }
56 /*
57 Allocate the new block of memory and append it into the list
58 */
60 {
61 #if SLOWLIST
63 #else
65 #endif
69 #if SLOWLIST
73 #else
75 #endif
86 }
89 /*
90 Reallocate the new block of memory and append it into the list
91 */
93 {
101 #if SLOWLIST
102 /* find the block */
103 {
107 {
109 {
111 }
114 }
119 }
120 #else
127 {
130 }
148 #endif
149 }
151 /*
152 Free the block of memory
153 */
155 {
163 #if SLOWLIST
164 /* find the block */
165 {
169 {
171 {
176 {
178 }
184 }
187 }
191 }
192 #else
197 #endif
209 {
211 }
213 }