commit 3038df214b3f593a1023f86797df6bce29a0a5f7
parent b44185a9ef0aaf2bbc5238cc639013b86bc61d21
Author: Oto Havle <havleoto@gmail.com>
Date: Sat, 10 Dec 2011 16:11:25 +0100
Tempfix: prevent recursion gc => free => gc
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kmem.c b/src/kmem.c
@@ -74,8 +74,9 @@ void *klispM_realloc_ (klisp_State *K, void *block, size_t osize, size_t nsize)
klisp_assert((osize == 0) == (block == NULL));
/* TEMP: for now only Stop the world GC */
+ /* TEMP: prevent recursive call of klispC_fullgc() */
#ifdef KUSE_GC
- if (K->totalbytes - osize + nsize >= K->GCthreshold) {
+ if (nsize > 0 && K->totalbytes - osize + nsize >= K->GCthreshold) {
#ifdef KDEBUG_GC
printf("GC START, total_bytes: %d\n", K->totalbytes);
#endif