Lines Matching refs:entry

60     AllocationEntry *entry = malloc(sizeof(AllocationEntry));
62 if (entry == NULL) {
66 entry->num_bytes = size;
67 entry->allocation = malloc(size);
68 if (entry->allocation == NULL) {
69 free(entry);
72 entry->next = NULL;
76 entry->prev = NULL;
77 alloc_head = alloc_tail = entry;
79 entry->prev = alloc_tail;
80 alloc_tail->next = entry;
81 alloc_tail = entry;
84 return entry->allocation;
90 AllocationEntry *entry;
92 for (entry = alloc_head; entry != NULL; entry = entry->next) {
93 if (entry->allocation == ptr) {
94 return entry;
104 AllocationEntry *entry;
107 /* There won't be an entry for this */
111 entry = find_allocation(ptr);
112 if (entry != NULL) {
114 if (entry->prev != NULL)
115 entry->prev->next = entry->next;
117 alloc_head = entry->next;
118 if (entry->next != NULL)
119 entry->next->prev = entry->prev;
121 alloc_tail = entry->next;
122 free(entry);
133 AllocationEntry *entry;
145 /* Find the allocation entry for this memory */
146 entry = find_allocation(ptr);
147 if (entry == NULL) {
149 entry = malloc(sizeof(AllocationEntry));
150 if (entry == NULL) {
154 entry->allocation = realloc(ptr, size);
155 if (entry->allocation == NULL) {
156 free(entry);
161 entry->next = NULL;
163 entry->prev = NULL;
164 alloc_head = alloc_tail = entry;
166 entry->prev = alloc_tail;
167 alloc_tail->next = entry;
168 alloc_tail = entry;
171 entry->allocation = realloc(ptr, size);
172 if (entry->allocation == NULL) {
174 entry->allocation = ptr;
179 entry->num_bytes = size;
180 return entry->allocation;
186 AllocationEntry *entry;
192 for (entry = alloc_head; entry != NULL; entry = entry->next)
195 (long unsigned)entry->num_bytes, entry->allocation);