This does not deallocate memory until the OS tells us that we are short
on memory, then tries to decommit all of the cached chunks (except for
the first page, used for the linked lists).
Nowhere near enough testing to commit to master yet!
The newer API (Windows 10 and newer) allows the allocator to ask for
strongly aligned memory.
This is enabled only if the `WINVER` macro is set to target Windows 10
or newer. There is now a CMake option to target older versions of
Windows, so we can test both code paths.
The Azure Pipelines config now includes a test of the compatibility
version. This runs only the release build, because it's mainly there as
a sanity check - 99% of the code is the same as the default Windows
config.
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.
Only the malloc/free/... interface is exported.
This allows all of C++'s weak ODR symbols to be resolved at
compile-time, rather than staying weak and resolved at load-time.
Since internal calls don't need to go through the PLT anymore, we get a
nice speedup, at least on small objects.
The rounding code can be integrated directly into the sizeclass code,
which means, the code paths can be simplified slightly.
The special case for zero mantissa bits is not required, as the compiler
generates the same code from the more complex path due to
eliminating dead code after folding the constant zero through.
RTTI makes the binaries bigger, exceptions make life harder for
optimisers. Neither are actually used.
This doesn't preclude anything #including snmalloc.h with RTTI enabled,
it just disables it in the shim libraries and tests.
The FreeBSD libc builds were already doing this with no ill effect.