This change introduces a per small sizeclass free list. That can be
used to access the free objects for that sizeclass with minimal
calculations being required.
It changes to a partial bump ptr. We bump allocate a whole OS
page worth of objects at a go, so we don't switch as frequently
between bump and free list allocation.
The code for the fast paths has been restructured to minimise the
work required on the common case, and also it is all inlined for the
common case.
Allocating a zero sized object is moved off the fast path. Ask for 1
byte if you want to be fast.
This is useful as codegen is nicer if we use size_t, but the semantics
is uint8_t, and is stored as that in many places in the metadata.
Ultimately should introduce a wrapper to check this invariant.
Introduce a `OnePastEnd` option for the pointer immediately after the
end of the allocation. This simplifies some of the logic in callers,
where they wants to say 'is base + length safe to use?'.
Also restructure some of the other logic somewhat.
Move slow_allocator into a separate header in the snmalloc namespace and
rename it for consistency with the rest of the codebase. Delete its
copy and move constructors / assignment operators.
Provide a hook so that the exported malloc symbols can be weak. This is
mostly needed so that rtld, which statically links libc.a, can override
the symbols.
Add a bootstrap allocator so that statically linked binaries can have
their TLS space allocated before malloc is called and uses TLS.