Lines Matching refs:best
24 #define TIDX_HEAP_EXTRA 2 // must be >= 0; best if > 0, don't make it > 7, since it unnecessarily limits max heap size we can manage
117 struct HeapNode *node, *best = NULL;
130 if (!node->used && node->size >= sz && (!best || best->size > node->size)) {
131 best = node;
132 if (best->size == sz)
139 if (!best) //alloc failed
142 if (best->size - sz > sizeof(struct HeapNode)) { //there is a point to split up the chunk
144 node = (struct HeapNode*)(best->data + sz);
148 node->size = best->size - sz - sizeof(struct HeapNode);
149 node->prev = best;
151 if (best != gHeapTail)
156 best->size = sz;
159 best->used = 1;
160 best->tidx = osGetCurrentTid();
161 ret = best->data;