Lines Matching full:best
690 * allocations are done in brute force best fit.
749 struct debug_alloc_header *best, *bestprev, *prev, *h; in debug_kmalloc() local
761 prev = best = bestprev = NULL; in debug_kmalloc()
763 if (h->size >= size && (!best || h->size < best->size)) { in debug_kmalloc()
764 best = h; in debug_kmalloc()
774 if (!best) in debug_kmalloc()
776 rem = best->size - size; in debug_kmalloc()
778 if (best->next == 0 && bestprev == NULL && rem < dah_overhead) in debug_kmalloc()
781 best->size = size; in debug_kmalloc()
782 h_offset = ((char *)best - debug_alloc_pool) + in debug_kmalloc()
783 dah_overhead + best->size; in debug_kmalloc()
786 h->next = best->next; in debug_kmalloc()
788 h_offset = best->next; in debug_kmalloc()
789 best->caller = __builtin_return_address(0); in debug_kmalloc()
790 dah_used += best->size; in debug_kmalloc()
796 p = (char *)best + dah_overhead; in debug_kmalloc()
797 memset(p, POISON_INUSE, best->size - 1); in debug_kmalloc()
798 *((char *)p + best->size - 1) = POISON_END; in debug_kmalloc()