Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
Allocator

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

Detailed Description

The allocator that every program in this project runs on.

This functionality is included as follows:

#include <sourcemeta/core/allocator.h>

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.

Enumeration Type Documentation

◆ Allocator

enum class sourcemeta::core::Allocator : std::uint8_t
strong

The allocators that a program can be built against.

Enumerator
Mimalloc 

The allocator this project vendors and links into its own programs.

System 

The allocator the platform ships with.

Function Documentation

◆ allocator()

SOURCEMETA_CORE_ALLOCATOR_EXPORT auto sourcemeta::core::allocator ( ) -> Allocator

Report the allocator this program was linked against. For example:

#include <sourcemeta/core/allocator.h>
#include <iostream>
auto main() -> int {
const auto selected{sourcemeta::core::allocator()};
std::cerr << "This program brings its own allocator\n";
}
}
SOURCEMETA_CORE_ALLOCATOR_EXPORT auto allocator() -> Allocator
@ Mimalloc
The allocator this project vendors and links into its own programs.
Definition allocator.h:30