From 7b82ace806fd05912ae6e9847714c33567c2268d Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 17 Nov 2025 22:31:10 -0500 Subject: [PATCH] xo-interpreter: prep for xo-symboltable --- README.md | 17 +++++++++++++++-- include/xo/alloc/Object.hpp | 2 -- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eeef6ca5..5a42f922 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ -# xo-alloc -- arena allocator with rudimentary GC support +# xo-alloc -- arena allocator and incremental garbage collector -Xo-alloc is a lightweight arena allocator +# Rules for writing garbage-collected classes. + +Topics +* allocation - allocate Objects (inheriting xo::Object) before owned scratch space. + Can relax this if/when abandon the bad-for-locality use of two pointers + into to-space to keep track of grey objects. Want to use stack anyway + so we can do depth-first search. +* destructors - can omit except for finalization +* assignment - MUST USE Object::assign_member() to assign pointers to gc-owned memory. + Only necessary for old->new pointers, so don't need to worry about this + for initialization. +* finalization - not supported (yet) + +- padding - use IAlloc::with_padding(z) for hand-allocated objects. diff --git a/include/xo/alloc/Object.hpp b/include/xo/alloc/Object.hpp index 81f0611c..a29b8de5 100644 --- a/include/xo/alloc/Object.hpp +++ b/include/xo/alloc/Object.hpp @@ -191,8 +191,6 @@ namespace xo { **/ virtual std::size_t _shallow_size() const = 0; - // TODO: _shallow_move() also overwrite *this with gc-only forwarding object point to C - /** if subject is allocated by GC: * - create copy C in to-space * - destination C will be nursery|tenured depending on location of this.