xo-arena: annex ArenaConfig.hpp from xo-alloc2/
This commit is contained in:
parent
5f882ca19d
commit
06456d07c6
1 changed files with 0 additions and 47 deletions
|
|
@ -1,47 +0,0 @@
|
|||
/** @file ArenaConfig.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AllocHeaderConfig.hpp"
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
|
||||
/** @class ArenaConfig
|
||||
*
|
||||
* @brief configuration for a @ref DArena instance
|
||||
**/
|
||||
struct ArenaConfig {
|
||||
/** @defgroup mm-arenaconfig-instance-vars ArenaConfig members **/
|
||||
///@{
|
||||
|
||||
/** optional name, for diagnostics **/
|
||||
std::string name_;
|
||||
/** desired arena size -- hard max = reserved virtual memory **/
|
||||
std::size_t size_ = 0;
|
||||
/** hugepage size -- using huge pages relieves some TLB pressure
|
||||
* (provided you use their full extent :)
|
||||
**/
|
||||
std::size_t hugepage_z_ = 2 * 1024 * 1024;
|
||||
/** true to store header (8 bytes) at the beginning of each allocation.
|
||||
* necessary and sufficient to allows iterating over allocs
|
||||
* present in arena
|
||||
**/
|
||||
bool store_header_flag_ = false;
|
||||
/** configuration for per-alloc header **/
|
||||
AllocHeaderConfig header_{};
|
||||
/** true to enable debug logging **/
|
||||
bool debug_flag_ = false;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ArenaConfig.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue