klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit cd4754ec13ede254a7aa489fc159f2c6948bc992
parent 3e29c9b57645e7b5285b1900270cb211c1d87f70
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu, 21 Apr 2011 12:50:25 -0300

Bugfix: in definition of K_TAG_FREE it said DEAD instead of FREE. Still segfaulting, problem seems to be with weak keys & gc.

Diffstat:
Msrc/kgc.c | 4++--
Msrc/klispconf.h | 2+-
Msrc/kobject.h | 2+-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/kgc.c b/src/kgc.c @@ -69,7 +69,7 @@ static void removeentry (Node *n) { klisp_assert(ttisfree(gval(n))); if (iscollectable(gkey(n)->this))/* dead key; remove it */ - gkey(n)->this = gc2deadkey(gcvalue(gkey(n)->this)); + gkey(n)->this = gc2deadkey(gcvalue(gkey(n)->this)); } static void reallymarkobject (klisp_State *K, GCObject *o) @@ -359,7 +359,7 @@ static void cleartable (GCObject *l) { while (i--) { Node *n = gnode(h, i); if (!ttisfree(gval(n)) && /* non-empty entry? */ - (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { + (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { gval(n) = KFREE; /* remove value ... */ removeentry(n); /* remove entry from table */ } diff --git a/src/klispconf.h b/src/klispconf.h @@ -16,7 +16,7 @@ /* temp defines till gc is stabilized */ #define KUSE_GC 1 /* Print msgs when starting and ending gc */ -/*#define KDEBUG_GC 1 */ +/* #define KDEBUG_GC 1 */ /* #define KTRACK_MARKS true diff --git a/src/kobject.h b/src/kobject.h @@ -192,7 +192,7 @@ typedef struct __attribute__ ((__packed__)) GCheader { #define K_TAG_EOF K_MAKE_VTAG(K_TEOF) #define K_TAG_BOOLEAN K_MAKE_VTAG(K_TBOOLEAN) #define K_TAG_CHAR K_MAKE_VTAG(K_TCHAR) -#define K_TAG_FREE K_MAKE_VTAG(K_TDEADKEY) +#define K_TAG_FREE K_MAKE_VTAG(K_TFREE) #define K_TAG_DEADKEY K_MAKE_VTAG(K_TDEADKEY) #define K_TAG_USER K_MAKE_VTAG(K_TUSER)