xo-alloc2: register DArena facet + subsystem init
This commit is contained in:
parent
16309dfff6
commit
e87073f914
7 changed files with 130 additions and 19 deletions
15
xo-alloc2/include/xo/alloc2/alloc2_register_facets.hpp
Normal file
15
xo-alloc2/include/xo/alloc2/alloc2_register_facets.hpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/** @file alloc2_register_facets.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
/** Register alloc2 (facet,impl) combinations with Facet Registry **/
|
||||
bool alloc2_register_facets();
|
||||
}
|
||||
}
|
||||
|
||||
/* end alloc2_register_facets.hpp */
|
||||
23
xo-alloc2/include/xo/alloc2/init_alloc2.hpp
Normal file
23
xo-alloc2/include/xo/alloc2/init_alloc2.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/** @file init_alloc2.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/subsys/Subsystem.hpp>
|
||||
|
||||
namespace xo {
|
||||
/* tag to represent the xo-alloc2/ subsystem within ordered initialization */
|
||||
enum S_alloc2_tag {};
|
||||
|
||||
template <>
|
||||
struct InitSubsys<S_alloc2_tag> {
|
||||
static void init();
|
||||
static InitEvidence require();
|
||||
};
|
||||
|
||||
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end init_alloc2.hpp */
|
||||
|
|
@ -3,26 +3,22 @@
|
|||
set(SELF_LIB xo_alloc2)
|
||||
set(SELF_SRCS
|
||||
|
||||
# AllocError.cpp
|
||||
# AllocInfo.cpp
|
||||
# cmpresult.cpp
|
||||
init_alloc2.cpp
|
||||
alloc2_register_facets.cpp
|
||||
|
||||
AAllocator.cpp
|
||||
# ArenaConfig.cpp
|
||||
# DArena.cpp
|
||||
IAllocator_Any.cpp
|
||||
IAllocator_DArena.cpp
|
||||
|
||||
IAllocIterator_Any.cpp
|
||||
# DArenaIterator.cpp
|
||||
IAllocIterator_DArenaIterator.cpp
|
||||
|
||||
IResourceVisitor_Any.cpp
|
||||
|
||||
)
|
||||
|
||||
xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})
|
||||
# note: deps here must also appear in cmake/xo_alloc2Config.cmake.in
|
||||
xo_dependency(${SELF_LIB} xo_arena)
|
||||
xo_dependency(${SELF_LIB} xo_facet)
|
||||
xo_dependency(${SELF_LIB} subsys)
|
||||
xo_dependency(${SELF_LIB} indentlog)
|
||||
|
|
|
|||
33
xo-alloc2/src/alloc2/alloc2_register_facets.cpp
Normal file
33
xo-alloc2/src/alloc2/alloc2_register_facets.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/** @file alloc2_register_facets.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#include "alloc2_register_facets.hpp"
|
||||
#include <xo/alloc2/Arena.hpp>
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::FacetRegistry;
|
||||
//using xo::facet::TypeRegistry;
|
||||
using xo::reflect::typeseq;
|
||||
|
||||
namespace mm {
|
||||
|
||||
bool
|
||||
alloc2_register_facets()
|
||||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
FacetRegistry::register_impl<AAllocator, DArena>();
|
||||
|
||||
log && log(xtag("DArena.tseq", typeseq::id<DArena>()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end alloc2_register_facets.cpp */
|
||||
36
xo-alloc2/src/alloc2/init_alloc2.cpp
Normal file
36
xo-alloc2/src/alloc2/init_alloc2.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/** @file init_alloc2.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#include "init_alloc2.hpp"
|
||||
#include "alloc2_register_facets.hpp"
|
||||
|
||||
namespace xo {
|
||||
using xo::mm::alloc2_register_facets;
|
||||
// using xo::mm::alloc2_register_types;
|
||||
// using xo::mm::CollectorTypeRegistry;
|
||||
|
||||
void
|
||||
InitSubsys<S_alloc2_tag>::init()
|
||||
{
|
||||
alloc2_register_facets();
|
||||
}
|
||||
|
||||
InitEvidence
|
||||
InitSubsys<S_alloc2_tag>::require()
|
||||
{
|
||||
InitEvidence retval;
|
||||
|
||||
/* direct subsystem deps for xo-alloc2/ (if/when) */
|
||||
//retval ^= InitSubsys<S_foo_tag>>::require();
|
||||
|
||||
/* xo-alloc2/'s own initialization code */
|
||||
retval ^= Subsystem::provide<S_alloc2_tag>("alloc2", &init);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end init_alloc2.cpp */
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
#include "object2_register_facets.hpp"
|
||||
#include "object2_register_types.hpp"
|
||||
#include <xo/gc/CollectorTypeRegistry.hpp>
|
||||
#include <xo/alloc2/init_alloc2.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::scm::object2_register_facets;
|
||||
|
|
@ -27,7 +28,7 @@ namespace xo {
|
|||
InitEvidence retval;
|
||||
|
||||
/* direct subsystem deps for xo-object2/ */
|
||||
// retval ^= InitSubsys<S_somedep_tag>::require();
|
||||
retval ^= InitSubsys<S_alloc2_tag>::require();
|
||||
|
||||
/* xo-expression2/'s own initialization code */
|
||||
retval ^= Subsystem::provide<S_object2_tag>("object2", &init);
|
||||
|
|
|
|||
|
|
@ -6,22 +6,29 @@
|
|||
#include "object2_register_facets.hpp"
|
||||
#include "RuntimeError.hpp"
|
||||
|
||||
#include <xo/object2/array/IGCObject_DArray.hpp>
|
||||
#include <xo/object2/list/IGCObject_DList.hpp>
|
||||
#include <xo/object2/boolean/IGCObject_DBoolean.hpp>
|
||||
#include <xo/object2/number/IGCObject_DFloat.hpp>
|
||||
#include <xo/object2/number/IGCObject_DInteger.hpp>
|
||||
#include <xo/object2/string/IGCObject_DString.hpp>
|
||||
#include <xo/object2/Array.hpp>
|
||||
//#include <xo/object2/List.hpp>
|
||||
#include <xo/object2/Boolean.hpp>
|
||||
#include <xo/object2/Integer.hpp>
|
||||
#include <xo/object2/Float.hpp>
|
||||
#include <xo/object2/String.hpp>
|
||||
|
||||
#include <xo/object2/array/IPrintable_DArray.hpp>
|
||||
//#include <xo/object2/array/IGCObject_DArray.hpp>
|
||||
#include <xo/object2/list/IGCObject_DList.hpp>
|
||||
//#include <xo/object2/boolean/IGCObject_DBoolean.hpp>
|
||||
//#include <xo/object2/number/IGCObject_DFloat.hpp>
|
||||
//#include <xo/object2/number/IGCObject_DInteger.hpp>
|
||||
//#include <xo/object2/string/IGCObject_DString.hpp>
|
||||
|
||||
//#include <xo/object2/array/IPrintable_DArray.hpp>
|
||||
#include <xo/object2/list/IPrintable_DList.hpp>
|
||||
#include <xo/object2/boolean/IPrintable_DBoolean.hpp>
|
||||
#include <xo/object2/number/IPrintable_DFloat.hpp>
|
||||
#include <xo/object2/number/IPrintable_DInteger.hpp>
|
||||
#include <xo/object2/string/IPrintable_DString.hpp>
|
||||
//#include <xo/object2/boolean/IPrintable_DBoolean.hpp>
|
||||
//#include <xo/object2/number/IPrintable_DFloat.hpp>
|
||||
//#include <xo/object2/number/IPrintable_DInteger.hpp>
|
||||
//#include <xo/object2/string/IPrintable_DString.hpp>
|
||||
|
||||
#include <xo/object2/list/ISequence_DList.hpp>
|
||||
#include <xo/object2/array/ISequence_DArray.hpp>
|
||||
//#include <xo/object2/array/ISequence_DArray.hpp>
|
||||
|
||||
#include <xo/printable2/detail/APrintable.hpp>
|
||||
#include <xo/alloc2/alloc/AAllocator.hpp>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue