xo-alloc2: refactor - explicit AllocHeader class
This commit is contained in:
parent
a757904dcc
commit
e369bc93f4
10 changed files with 251 additions and 37 deletions
32
xo-alloc2/include/xo/alloc2/gc/object_age.hpp
Normal file
32
xo-alloc2/include/xo/alloc2/gc/object_age.hpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/** @file object_age.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
/** hard maximum remembered object age **/
|
||||
static constexpr uint32_t c_max_object_age = 127;
|
||||
|
||||
/** @class object_age
|
||||
* @brief type-safe object age
|
||||
*
|
||||
* Object age measured in number of garbage collections survived.
|
||||
**/
|
||||
struct object_age {
|
||||
using value_type = std::uint32_t;
|
||||
|
||||
explicit object_age(value_type x) : value_{x} {}
|
||||
|
||||
operator value_type() const { return value_; }
|
||||
|
||||
std::uint32_t value_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* end object_age.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue