Lines Matching full:best
689 * allocations are done in brute force best fit.
748 struct debug_alloc_header *best, *bestprev, *prev, *h; in debug_kmalloc() local
760 prev = best = bestprev = NULL; in debug_kmalloc()
762 if (h->size >= size && (!best || h->size < best->size)) { in debug_kmalloc()
763 best = h; in debug_kmalloc()
773 if (!best) in debug_kmalloc()
775 rem = best->size - size; in debug_kmalloc()
777 if (best->next == 0 && bestprev == NULL && rem < dah_overhead) in debug_kmalloc()
780 best->size = size; in debug_kmalloc()
781 h_offset = ((char *)best - debug_alloc_pool) + in debug_kmalloc()
782 dah_overhead + best->size; in debug_kmalloc()
785 h->next = best->next; in debug_kmalloc()
787 h_offset = best->next; in debug_kmalloc()
788 best->caller = __builtin_return_address(0); in debug_kmalloc()
789 dah_used += best->size; in debug_kmalloc()
795 p = (char *)best + dah_overhead; in debug_kmalloc()
796 memset(p, POISON_INUSE, best->size - 1); in debug_kmalloc()
797 *((char *)p + best->size - 1) = POISON_END; in debug_kmalloc()