Lines Matching refs:entry
60 AllocationEntry *entry = malloc(sizeof(AllocationEntry)); in tracking_malloc() local
62 if (entry == NULL) { in tracking_malloc()
66 entry->num_bytes = size; in tracking_malloc()
67 entry->allocation = malloc(size); in tracking_malloc()
68 if (entry->allocation == NULL) { in tracking_malloc()
69 free(entry); in tracking_malloc()
72 entry->next = NULL; in tracking_malloc()
76 entry->prev = NULL; in tracking_malloc()
77 alloc_head = alloc_tail = entry; in tracking_malloc()
79 entry->prev = alloc_tail; in tracking_malloc()
80 alloc_tail->next = entry; in tracking_malloc()
81 alloc_tail = entry; in tracking_malloc()
84 return entry->allocation; in tracking_malloc()
90 AllocationEntry *entry; in find_allocation() local
92 for (entry = alloc_head; entry != NULL; entry = entry->next) { in find_allocation()
93 if (entry->allocation == ptr) { in find_allocation()
94 return entry; in find_allocation()
104 AllocationEntry *entry; in tracking_free() local
111 entry = find_allocation(ptr); in tracking_free()
112 if (entry != NULL) { in tracking_free()
114 if (entry->prev != NULL) in tracking_free()
115 entry->prev->next = entry->next; in tracking_free()
117 alloc_head = entry->next; in tracking_free()
118 if (entry->next != NULL) in tracking_free()
119 entry->next->prev = entry->prev; in tracking_free()
121 alloc_tail = entry->next; in tracking_free()
122 free(entry); in tracking_free()
133 AllocationEntry *entry; in tracking_realloc() local
146 entry = find_allocation(ptr); in tracking_realloc()
147 if (entry == NULL) { in tracking_realloc()
149 entry = malloc(sizeof(AllocationEntry)); in tracking_realloc()
150 if (entry == NULL) { in tracking_realloc()
154 entry->allocation = realloc(ptr, size); in tracking_realloc()
155 if (entry->allocation == NULL) { in tracking_realloc()
156 free(entry); in tracking_realloc()
161 entry->next = NULL; in tracking_realloc()
163 entry->prev = NULL; in tracking_realloc()
164 alloc_head = alloc_tail = entry; in tracking_realloc()
166 entry->prev = alloc_tail; in tracking_realloc()
167 alloc_tail->next = entry; in tracking_realloc()
168 alloc_tail = entry; in tracking_realloc()
171 entry->allocation = realloc(ptr, size); in tracking_realloc()
172 if (entry->allocation == NULL) { in tracking_realloc()
174 entry->allocation = ptr; in tracking_realloc()
179 entry->num_bytes = size; in tracking_realloc()
180 return entry->allocation; in tracking_realloc()
186 AllocationEntry *entry; in tracking_report() local
192 for (entry = alloc_head; entry != NULL; entry = entry->next) in tracking_report()
195 (long unsigned)entry->num_bytes, entry->allocation); in tracking_report()