Lines Matching +full:- +full:- +full:needed
15 unsigned char *start = g->mem->storage + stride*idx; in realloc()
16 unsigned char *end = start + stride - IB; in realloc()
18 size_t avail_size = end-(unsigned char *)p; in realloc()
21 // only resize in-place if size class matches in realloc()
23 && size_to_class(n)+1 >= g->sizeclass) { in realloc()
28 // use mremap if old and new size are both mmap-worthy in realloc()
29 if (g->sizeclass>=48 && n>=MMAP_THRESHOLD) { in realloc()
30 assert(g->sizeclass==63); in realloc()
31 size_t base = (unsigned char *)p-start; in realloc()
32 size_t needed = (n + base + UNIT + IB + 4095) & -4096; in realloc() local
33 new = g->maplen*4096UL == needed ? g->mem : in realloc()
34 mremap(g->mem, g->maplen*4096UL, needed, MREMAP_MAYMOVE); in realloc()
36 g->mem = new; in realloc()
37 g->maplen = needed/4096; in realloc()
38 p = g->mem->storage + base; in realloc()
39 end = g->mem->storage + (needed - UNIT) - IB; in realloc()