#include "mtcore_thread/core.hpp"
#include "mtcore/alloc.hpp"
#include <mutex>
Go to the source code of this file.
|
namespace | mtcore |
| Core library for C++ with Zig-related functionality.
|
|
namespace | mtcore::thread |
| Thread-related namespace The methods and classes provided by this class are thread-safe Classes and methods provided outside of this class are not thread-safe (with the exception of malloc_alloc) This requires linking mtcore_thread to your application.
|
|
|
DynamicArenaAllocator | mtcore::thread::dynamic_arena (Allocator *root, size_t elementSizeHint, size_t elementCountHint) noexcept |
| Creates a dynamically growing arena allocator This arena allocator will grow if it runs out of space The allocator will clean all pages on deinit, and reallocate them again when the next allocation happens It does iterate through all pages, so it's \(O(p)\) to allocate Use maxElementHint (max element size) and maxCountHint (max number of elements per page) to hint at page size.
|
|
FixedArenaAllocator | mtcore::thread::fixed_arena (Slice< u8 > bytes) noexcept |
| Creates basic arena allocator which just pushes more state onto the end Calling deinit will simply reset the stack pointer.
|
|
FixedBufferAllocator | mtcore::thread::fixed_buff (Slice< u8 > bytes) noexcept |
| Creates an allocator that works on a fixed buffer of bytes.
|
|
DebugAllocator | mtcore::thread::debug_alloc () noexcept |
| Creates a memory allocator using the standard's malloc under the hood This allocator will do basic tracking of memory allocations Once all instances of std_alloc are de-initialized, it will then check to see if any memory is being leakd.
|
|
◆ MTCORE_THREAD_ALLOC_HPP
#define MTCORE_THREAD_ALLOC_HPP |