From b7f82245885ffe0fdaff0e32ea83f1975e03c1ec Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 20 Aug 2023 14:53:25 -0500 Subject: [PATCH 1/2] Address #1263 Fix reference counting when cleaning up unused abstract types per-thread. --- src/core/gc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/gc.c b/src/core/gc.c index f0ecdd9a..c2a89877 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -370,14 +370,15 @@ void janet_sweep() { if (head->type->gc) { janet_assert(!head->type->gc(head->data, head->size), "finalizer failed"); } - /* Mark as tombstone in place */ - items[i].key = janet_wrap_nil(); - items[i].value = janet_wrap_false(); - janet_vm.threaded_abstracts.deleted++; - janet_vm.threaded_abstracts.count--; /* Free memory */ janet_free(janet_abstract_head(abst)); } + + /* Mark as tombstone in place */ + items[i].key = janet_wrap_nil(); + items[i].value = janet_wrap_false(); + janet_vm.threaded_abstracts.deleted++; + janet_vm.threaded_abstracts.count--; } /* Reset for next sweep */ From ee01045db57ba8f2a1edd1e21332aee8930009ba Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 20 Aug 2023 15:56:58 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3877890..ad635b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog All notable changes to this project will be documented in this file. +## ??? - Unreleased +- Add `os/sigaction` +- Change `every?` and `any?` to behave like the functional versions of the `and` and `or` macros. +- Fix bug with garbage collecting threaded abstract types. +- Add `:signal` to the `sandbox` function to allow intercepting signals. + ## 1.30.0 - 2023-08-05 - Change indexing of `array/remove` to start from -1 at the end instead of -2. - Add new string escape sequences `\\a`, `\\b`, `\\?`, and `\\'`.