xo-gc: move mlog handling to separate tru MutationLogState.*pp

Still entangled with DX1Collector for object spaces
This commit is contained in:
Roland Conybeare 2026-04-02 00:09:08 -04:00
commit 486de5d397
9 changed files with 752 additions and 360 deletions

View file

@ -0,0 +1,51 @@
/** @file X1VerifyStats.hpp
*
* @author Roland Conybeare, Apr 2026
**/
#pragma once
#include <cstdint>
namespace xo {
namespace mm {
/** @brief info collected during a @ref DX1Collector::verify_ok call
* (or @ref MutationLogState::verify_ok call)
**/
class VerifyStats {
public:
bool is_ok() const noexcept {
return (n_from_ == 0) && (n_fwd_ == 0) && (n_no_iface_ == 0);
}
void clear() { *this = VerifyStats(); }
/** number of gc roots examined **/
std::uint32_t n_gc_root_ = 0;
std::uint32_t n_ext_ = 0;
/** number of from-space objects encountered. Fatal if non-zero **/
std::uint32_t n_from_ = 0;
/** number of to-space objects encountered. **/
std::uint32_t n_to_ = 0;
/** counts forwarding object encountered in to-space scan. Fatal if non-zero **/
std::uint32_t n_fwd_ = 0;
/** counts missing GCObject interface. Fatal if non-zero **/
std::uint32_t n_no_iface_ = 0;
/** live mlog entry refers to to-space, as expected **/
std::uint32_t n_mlog_vital_ = 0;
/** stale mlog entry. not troubling to verify these **/
std::uint32_t n_mlog_stale_ = 0;
/** live mlog entry refers to from-space. Fatal if non-zero **/
std::uint32_t n_mlog_from_ = 0;
/** live mlog entry refers to either some other generation or outside gc-space.
* Fatal if non-zero
**/
std::uint32_t n_mlog_wild_ = 0;
};
} /*namespace mm*/
} /*namespace xo*/
/* end X1VerifyStats.hpp */