Lines Matching refs:cur
118 memory_header *cur = heap.first; in debug_chain() local
121 while( cur != NULL ) in debug_chain()
123 debug_header( cur ); in debug_chain()
124 cur = cur->next; in debug_chain()
128 cur = heap.first_free; in debug_chain()
130 while( cur != NULL ) in debug_chain()
132 debug_header( cur ); in debug_chain()
133 cur = cur->next_free; in debug_chain()
185 memory_header *prv = heap.first, *cur = heap.first->next; in verify_chain() local
205 while( cur != NULL ) in verify_chain()
207 if( verify_header( cur ) != 0 ) in verify_chain()
216 if( cur->prev != prv ) in verify_chain()
225 prv = cur; in verify_chain()
226 cur = cur->next; in verify_chain()
234 memory_header *new, *cur = heap.first_free; in buffer_alloc_calloc() local
259 while( cur != NULL ) in buffer_alloc_calloc()
261 if( cur->size >= len ) in buffer_alloc_calloc()
264 cur = cur->next_free; in buffer_alloc_calloc()
267 if( cur == NULL ) in buffer_alloc_calloc()
270 if( cur->alloc != 0 ) in buffer_alloc_calloc()
285 if( cur->size - len < sizeof(memory_header) + in buffer_alloc_calloc()
288 cur->alloc = 1; in buffer_alloc_calloc()
292 if( cur->prev_free != NULL ) in buffer_alloc_calloc()
293 cur->prev_free->next_free = cur->next_free; in buffer_alloc_calloc()
295 heap.first_free = cur->next_free; in buffer_alloc_calloc()
297 if( cur->next_free != NULL ) in buffer_alloc_calloc()
298 cur->next_free->prev_free = cur->prev_free; in buffer_alloc_calloc()
300 cur->prev_free = NULL; in buffer_alloc_calloc()
301 cur->next_free = NULL; in buffer_alloc_calloc()
304 heap.total_used += cur->size; in buffer_alloc_calloc()
310 cur->trace = backtrace_symbols( trace_buffer, trace_cnt ); in buffer_alloc_calloc()
311 cur->trace_count = trace_cnt; in buffer_alloc_calloc()
317 ret = (unsigned char *) cur + sizeof( memory_header ); in buffer_alloc_calloc()
323 p = ( (unsigned char *) cur ) + sizeof(memory_header) + len; in buffer_alloc_calloc()
326 new->size = cur->size - len - sizeof(memory_header); in buffer_alloc_calloc()
328 new->prev = cur; in buffer_alloc_calloc()
329 new->next = cur->next; in buffer_alloc_calloc()
342 new->prev_free = cur->prev_free; in buffer_alloc_calloc()
343 new->next_free = cur->next_free; in buffer_alloc_calloc()
352 cur->alloc = 1; in buffer_alloc_calloc()
353 cur->size = len; in buffer_alloc_calloc()
354 cur->next = new; in buffer_alloc_calloc()
355 cur->prev_free = NULL; in buffer_alloc_calloc()
356 cur->next_free = NULL; in buffer_alloc_calloc()
362 heap.total_used += cur->size; in buffer_alloc_calloc()
368 cur->trace = backtrace_symbols( trace_buffer, trace_cnt ); in buffer_alloc_calloc()
369 cur->trace_count = trace_cnt; in buffer_alloc_calloc()
375 ret = (unsigned char *) cur + sizeof( memory_header ); in buffer_alloc_calloc()