WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
default_allocator.hpp
Go to the documentation of this file.
1// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors
2// SPDX-License-Identifier: Zlib
3
4#ifndef WPI_MEMORY_DEFAULT_ALLOCATOR_HPP_INCLUDED
5#define WPI_MEMORY_DEFAULT_ALLOCATOR_HPP_INCLUDED
6
7/// \file
8/// The typedef \ref wpi::memory::default_allocator.
9
10#include "config.hpp"
11#include "heap_allocator.hpp"
12#include "new_allocator.hpp"
13#include "static_allocator.hpp"
14#include "virtual_memory.hpp"
15
16#if WPI_HOSTED_IMPLEMENTATION
17#include "malloc_allocator.hpp"
18#endif
19
20namespace wpi
21{
22 namespace memory
23 {
24 /// The default RawAllocator that will be used as BlockAllocator in memory arenas.
25 /// Arena allocators like \ref memory_stack or \ref memory_pool allocate memory by subdividing a huge block.
26 /// They get a BlockAllocator that will be used for their internal allocation,
27 /// this type is the default value.
28 /// \requiredbe Its type can be changed via the CMake option \c WPI_MEMORY_DEFAULT_ALLCOATOR,
29 /// but it must be one of the following: \ref heap_allocator, \ref new_allocator, \ref malloc_allocator, \ref static_allocator, \ref virtual_memory_allocator.
30 /// \defaultbe The default is \ref heap_allocator.
31 /// \ingroup memory_allocator
33 } // namespace memory
34} // namespace wpi
35
36#endif // WPI_MEMORY_DEFAULT_ALLOCATOR_HPP_INCLUDED
Configuration macros.
#define WPI_MEMORY_IMPL_DEFAULT_ALLOCATOR
Definition config_impl.hpp:15
implementation_defined default_allocator
The default RawAllocator that will be used as BlockAllocator in memory arenas.
Definition default_allocator.hpp:32
Class wpi::memory::heap_allocator and related functions.
Class wpi::memory::malloc_allocator.
Memory namespace.
Definition heap_allocator.hpp:20
Foonathan namespace.
Definition ntcore_cpp.h:26
Class wpi::memory::new_allocator.
Allocators using a static, fixed-sized storage.
Virtual memory api and (low-level) allocator classes.