Merge branch 'claude1' of github.com:rconybea/xo-umbrella2 into claude1
This commit is contained in:
commit
67bb07f6ac
2 changed files with 47 additions and 48 deletions
|
|
@ -1,48 +0,0 @@
|
|||
/** @file IGCObject_Any.cpp
|
||||
*
|
||||
**/
|
||||
|
||||
#include "detail/IGCObject_Any.hpp"
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
|
||||
using xo::facet::DVariantPlaceholder;
|
||||
using xo::facet::typeseq;
|
||||
using xo::facet::valid_facet_implementation;
|
||||
|
||||
void
|
||||
IGCObject_Any::_fatal()
|
||||
{
|
||||
/* control here on uninitialized IAllocator_Any.
|
||||
* Initialized instance will have specific implementation type
|
||||
*/
|
||||
std::cerr << "fatal"
|
||||
<< ": attempt to call uninitialized"
|
||||
<< " IGCObject_Any method"
|
||||
<< std::endl;
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
typeseq
|
||||
IGCObject_Any::s_typeseq = typeseq::id<DVariantPlaceholder>();
|
||||
|
||||
bool
|
||||
IGCObject_Any::_valid
|
||||
= valid_facet_implementation<AGCObject, IGCObject_Any>();
|
||||
|
||||
// nonconst methods
|
||||
|
||||
auto
|
||||
IGCObject_Any::forward_children(Opaque, obj<ACollector>) const noexcept -> size_type
|
||||
{
|
||||
_fatal();
|
||||
}
|
||||
|
||||
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IGCObject_Any.cpp */
|
||||
47
xo-gc/include/xo/gc/MutationLogEntry.hpp
Normal file
47
xo-gc/include/xo/gc/MutationLogEntry.hpp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/** @file MutationLogEntry.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Mar 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
|
||||
/** @brief Track a cross-generational pointer
|
||||
*
|
||||
* GC must update pointer when collecting space that target occupies
|
||||
*
|
||||
* Design notes:
|
||||
* - parent must be located at the beginning of an allocation,
|
||||
* (so that it's immediately preceded by allocation header)
|
||||
* - destination can be something like
|
||||
* obj<AGCObject>
|
||||
* but also something else such as
|
||||
* {obj<AType>, obj<ASyntaxStateMachine>, ..}
|
||||
* - for collector need to traverse data pointer *data
|
||||
**/
|
||||
class MutationLogEntry {
|
||||
public:
|
||||
MutationLogEntry(void * parent, void ** p_data, obj<AGCObject> snap);
|
||||
|
||||
private:
|
||||
/** address of object containing logged mutation **/
|
||||
void * parent_ = nullptr;
|
||||
/** address of target member of object at address @ref parent_,
|
||||
* driving this log entry.
|
||||
**/
|
||||
void ** p_data_ = nullptr;
|
||||
/** AGCObject i/face pointer, asof assignment responsible for this log entry.
|
||||
* If *p_data_ matches snap_.data(), then AGCObject interface is snap_.iface().
|
||||
* Otherwise log entry has been superseded by another assignment.
|
||||
**/
|
||||
obj<AGCObject> snap_;
|
||||
};
|
||||
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end MutationLogEntry.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue