From 4aab28411a45d1ae31b0892225b391bc3cbac103 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Wed, 2 Sep 2026 12:58:47 -0500 Subject: [PATCH] Replace time-based GC with allocation-count trigger, migrate all Create factories to GCList::Create(), fix VFSPath root path, reorder TObject variant --- src/vm/gc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vm/gc.cpp b/src/vm/gc.cpp index e4e6ebf..b3cb524 100644 --- a/src/vm/gc.cpp +++ b/src/vm/gc.cpp @@ -113,9 +113,8 @@ void GC::Start() { this->thrd = new Thread([this]() -> void { while (this->IsRunning()) { this->BarrierBegin(); - while (this->allocs < ALLOC_THRESHOLD) - this->cond.Wait( - &this->mtx); // your wrapper around pthread_cond_wait + while (this->IsRunning() && (this->allocs < ALLOC_THRESHOLD)) + this->cond.Wait(&this->mtx); this->allocs = 0; std::vector to_delete; this->Collect(to_delete);