remove or make static various unused __-prefixed symbols
[musl.git] / src / malloc / DESIGN
blob58b0523ffdba15b8a0c493578458bc364f45857a
3 In principle, this memory allocator is roughly equivalent to Doug
4 Lea's dlmalloc with fine-grained locking.
8 malloc:
10 Uses a freelist binned by chunk size, with a bitmap to optimize
11 searching for the smallest non-empty bin which can satisfy an
12 allocation. If no free chunks are available, it creates a new chunk of
13 the requested size and attempts to merge it with any existing free
14 chunk immediately below the newly created chunk.
16 Whether the chunk was obtained from a bin or newly created, it's
17 likely to be larger than the requested allocation. malloc always
18 finishes its work by passing the new chunk to realloc, which will
19 split it into two chunks and free the tail portion.