Replace time-based GC with allocation-count trigger, migrate all Create factories to GCList::Create(), fix VFSPath root path, reorder TObject variant

This commit is contained in:
2026-09-01 05:15:43 -05:00
parent 56b74dc6fc
commit 2430b62232
38 changed files with 888 additions and 806 deletions
+2 -11
View File
@@ -1,7 +1,6 @@
#include "CrossLang.hpp"
namespace Tesses::CrossLang {
TNativeObject::~TNativeObject() {}
TNative::TNative(void *ptr, std::function<void(void *)> destroy) {
this->ptr = ptr;
@@ -34,19 +33,11 @@ bool TNativeObject::Equals(std::shared_ptr<GC> gc, TObject right) {
}
TNative *TNative::Create(GCList &ls, void *ptr,
std::function<void(void *)> destroy) {
TNative *native = new TNative(ptr, destroy);
std::shared_ptr<GC> gc = ls.GetGC();
ls.Add(native);
gc->Watch(native);
return native;
return ls.Create<TNative>(ptr, destroy);
}
TNative *TNative::Create(GCList *ls, void *ptr,
std::function<void(void *)> destroy) {
TNative *native = new TNative(ptr, destroy);
std::shared_ptr<GC> gc = ls->GetGC();
ls->Add(native);
gc->Watch(native);
return native;
return ls->Create<TNative>(ptr, destroy);
}
TNative::~TNative() { this->Destroy(); }