The allocator that every program in this project runs on. More...
Enumerations | |
| enum class | sourcemeta::core::Allocator : std::uint8_t { Allocator::Mimalloc , Allocator::System } |
Functions | |
| SOURCEMETA_CORE_ALLOCATOR_EXPORT auto | sourcemeta::core::allocator () -> Allocator |
The allocator that every program in this project runs on.
This functionality is included as follows:
Linking this library into a program is what puts its allocator in place, as the standard allocation entry points it defines are the ones the program already calls. No other library in this project links it, so a program that does not ask for it keeps the allocator its platform ships with.
Where this library brings an allocator of its own, it defines those entry points itself and forwards each of them on to it, so that what a program gets by linking it is settled here rather than by whichever allocator that happens to be. What it replaces is the general purpose allocation and deallocation entry points of the C library, the alignment aware and platform specific extensions offered alongside them, and every replaceable allocation function of C++.
Not every build brings one. A build for a platform this project does not vendor an allocator for, a build under a sanitiser, and a build that asked for the platform allocator outright all define no entry point at all and leave the platform's own in place, which is what makes this report worth asking for rather than assuming.
|
strong |
| SOURCEMETA_CORE_ALLOCATOR_EXPORT auto sourcemeta::core::allocator | ( | ) | -> Allocator |
Report the allocator this program was linked against. For example: