Home | History | Annotate | Download | only in tests

Lines Matching refs:entry

58   AllocationEntry *const entry
61 if (entry == NULL) {
65 entry->num_bytes = size;
66 entry->allocation = malloc(size);
67 if (entry->allocation == NULL) {
68 free(entry);
71 entry->next = NULL;
75 entry->prev = NULL;
76 alloc_head = alloc_tail = entry;
78 entry->prev = alloc_tail;
79 alloc_tail->next = entry;
80 alloc_tail = entry;
83 return entry->allocation;
88 AllocationEntry *entry;
90 for (entry = alloc_head; entry != NULL; entry = entry->next) {
91 if (entry->allocation == ptr) {
92 return entry;
101 AllocationEntry *entry;
104 /* There won't be an entry for this */
108 entry = find_allocation(ptr);
109 if (entry != NULL) {
111 if (entry->prev != NULL)
112 entry->prev->next = entry->next;
114 alloc_head = entry->next;
115 if (entry->next != NULL)
116 entry->next->prev = entry->prev;
118 alloc_tail = entry->next;
119 free(entry);
129 AllocationEntry *entry;
141 /* Find the allocation entry for this memory */
142 entry = find_allocation(ptr);
143 if (entry == NULL) {
145 entry = (AllocationEntry *)malloc(sizeof(AllocationEntry));
146 if (entry == NULL) {
150 entry->allocation = realloc(ptr, size);
151 if (entry->allocation == NULL) {
152 free(entry);
157 entry->next = NULL;
159 entry->prev = NULL;
160 alloc_head = alloc_tail = entry;
162 entry->prev = alloc_tail;
163 alloc_tail->next = entry;
164 alloc_tail = entry;
171 entry->allocation = reallocated;
174 entry->num_bytes = size;
175 return entry->allocation;
180 AllocationEntry *entry;
186 for (entry = alloc_head; entry != NULL; entry = entry->next) {
187 printf("Allocated %lu bytes at %p\n", (long unsigned)entry->num_bytes,
188 entry->allocation);