Type-erased, two-word handle for classifying memory regions and addresses.
More...
#include <memory_classifier.hpp>
|
| struct | vtable |
| | Virtual table of memory classification operations. More...
|
| |
|
| constexpr | memory_classifier_ref () noexcept=default |
| | Constructs an empty (invalid) handle.
|
| |
| template<typename Tag , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0> |
| constexpr | memory_classifier_ref (Tag) noexcept |
| | Constructs a handle for a stateless classifier tag.
|
| |
| template<typename Tag , typename Context , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type > &&std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0> |
| constexpr | memory_classifier_ref (Tag, const Context &ctx RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept |
| | Constructs a handle for a stateful classifier tag.
|
| |
| template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0> |
| constexpr | memory_classifier_ref (Tag, Context &&)=delete |
| |
| bool | classify_address (uintptr_t virt_addr, memory_region_info &out_info) const noexcept |
| | Classifies a target virtual address.
|
| |
| constexpr | operator bool () const noexcept |
| | Reports whether the handle is bound to a classifier.
|
| |
|
| template<typename Tag , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0> |
| static constexpr memory_classifier_ref | make () noexcept |
| |
| template<typename Tag , typename Context , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type >, int > = 0> |
| static constexpr memory_classifier_ref | make (const Context &ctx RELOCO_LIFETIMEBOUND) noexcept |
| |
| template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0> |
| static memory_classifier_ref | make (Context &&)=delete |
| |
Type-erased, two-word handle for classifying memory regions and addresses.
Packs a context pointer and a virtual table into two words, avoiding allocations, RTTI, and virtual dispatch.
◆ memory_classifier_ref() [1/4]
| constexpr microfmt::memory_classifier_ref::memory_classifier_ref |
( |
| ) |
|
|
constexprdefaultnoexcept |
Constructs an empty (invalid) handle.
◆ memory_classifier_ref() [2/4]
template<typename Tag , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0>
| constexpr microfmt::memory_classifier_ref::memory_classifier_ref |
( |
Tag |
| ) |
|
|
inlineexplicitconstexprnoexcept |
Constructs a handle for a stateless classifier tag.
◆ memory_classifier_ref() [3/4]
template<typename Tag , typename Context , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type > &&std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
| constexpr microfmt::memory_classifier_ref::memory_classifier_ref |
( |
Tag |
, |
|
|
const Context &ctx RELOCO_LIFETIMEBOUND |
RELOCO_LIFETIME_CAPTURE_BY_THIS |
|
) |
| |
|
inlineconstexprnoexcept |
Constructs a handle for a stateful classifier tag.
◆ memory_classifier_ref() [4/4]
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
| constexpr microfmt::memory_classifier_ref::memory_classifier_ref |
( |
Tag |
, |
|
|
Context && |
|
|
) |
| |
|
constexprdelete |
◆ classify_address()
| bool microfmt::memory_classifier_ref::classify_address |
( |
uintptr_t |
virt_addr, |
|
|
memory_region_info & |
out_info |
|
) |
| const |
|
inlinenoexcept |
Classifies a target virtual address.
- Parameters
-
| virt_addr | Virtual address to inspect. |
| out_info | Receives metadata about the memory region. |
- Returns
true on successful classification, false otherwise.
◆ make() [1/3]
template<typename Tag , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0>
|
|
inlinestaticconstexprnoexcept |
◆ make() [2/3]
template<typename Tag , typename Context , typename Traits = memory_classifier_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type >, int > = 0>
| static constexpr memory_classifier_ref microfmt::memory_classifier_ref::make |
( |
const Context &ctx |
RELOCO_LIFETIMEBOUND | ) |
|
|
inlinestaticconstexprnoexcept |
◆ make() [3/3]
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
◆ operator bool()
| constexpr microfmt::memory_classifier_ref::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Reports whether the handle is bound to a classifier.
The documentation for this class was generated from the following file: