Lines Matching refs:cur
95 memory_header *cur = heap.first; in debug_chain() local
98 while (cur != NULL) { in debug_chain()
99 debug_header(cur); in debug_chain()
100 cur = cur->next; in debug_chain()
104 cur = heap.first_free; in debug_chain()
106 while (cur != NULL) { in debug_chain()
107 debug_header(cur); in debug_chain()
108 cur = cur->next_free; in debug_chain()
155 memory_header *prv = heap.first, *cur; in verify_chain() local
173 cur = heap.first->next; in verify_chain()
175 while (cur != NULL) { in verify_chain()
176 if (verify_header(cur) != 0) { in verify_chain()
184 if (cur->prev != prv) { in verify_chain()
192 prv = cur; in verify_chain()
193 cur = cur->next; in verify_chain()
201 memory_header *new, *cur = heap.first_free; in buffer_alloc_calloc() local
229 while (cur != NULL) { in buffer_alloc_calloc()
230 if (cur->size >= len) { in buffer_alloc_calloc()
234 cur = cur->next_free; in buffer_alloc_calloc()
237 if (cur == NULL) { in buffer_alloc_calloc()
241 if (cur->alloc != 0) { in buffer_alloc_calloc()
255 if (cur->size - len < sizeof(memory_header) + in buffer_alloc_calloc()
257 cur->alloc = 1; in buffer_alloc_calloc()
261 if (cur->prev_free != NULL) { in buffer_alloc_calloc()
262 cur->prev_free->next_free = cur->next_free; in buffer_alloc_calloc()
264 heap.first_free = cur->next_free; in buffer_alloc_calloc()
267 if (cur->next_free != NULL) { in buffer_alloc_calloc()
268 cur->next_free->prev_free = cur->prev_free; in buffer_alloc_calloc()
271 cur->prev_free = NULL; in buffer_alloc_calloc()
272 cur->next_free = NULL; in buffer_alloc_calloc()
275 heap.total_used += cur->size; in buffer_alloc_calloc()
282 cur->trace = backtrace_symbols(trace_buffer, trace_cnt); in buffer_alloc_calloc()
283 cur->trace_count = trace_cnt; in buffer_alloc_calloc()
290 ret = (unsigned char *) cur + sizeof(memory_header); in buffer_alloc_calloc()
296 p = ((unsigned char *) cur) + sizeof(memory_header) + len; in buffer_alloc_calloc()
299 new->size = cur->size - len - sizeof(memory_header); in buffer_alloc_calloc()
301 new->prev = cur; in buffer_alloc_calloc()
302 new->next = cur->next; in buffer_alloc_calloc()
316 new->prev_free = cur->prev_free; in buffer_alloc_calloc()
317 new->next_free = cur->next_free; in buffer_alloc_calloc()
328 cur->alloc = 1; in buffer_alloc_calloc()
329 cur->size = len; in buffer_alloc_calloc()
330 cur->next = new; in buffer_alloc_calloc()
331 cur->prev_free = NULL; in buffer_alloc_calloc()
332 cur->next_free = NULL; in buffer_alloc_calloc()
339 heap.total_used += cur->size; in buffer_alloc_calloc()
346 cur->trace = backtrace_symbols(trace_buffer, trace_cnt); in buffer_alloc_calloc()
347 cur->trace_count = trace_cnt; in buffer_alloc_calloc()
354 ret = (unsigned char *) cur + sizeof(memory_header); in buffer_alloc_calloc()