Skip to content
Snippets Groups Projects
Commit d9c6f02f authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

bugfix for gc callback

Rev: src/gc.h:1.41
parent 06fe8778
No related branches found
No related tags found
No related merge requests found
/*
* $Id: gc.h,v 1.40 2000/05/04 03:14:31 hubbe Exp $
* $Id: gc.h,v 1.41 2000/05/16 08:37:24 hubbe Exp $
*/
#ifndef GC_H
#define GC_H
......@@ -21,7 +21,7 @@ extern struct callback_list evaluator_callbacks;
extern void *gc_svalue_location;
#endif
#define ADD_GC_CALLBACK() gc_evaluator_callback=add_to_callback(&evaluator_callbacks,(callback_func)do_gc,0,0)
#define ADD_GC_CALLBACK() do { if(!gc_evaluator_callback) gc_evaluator_callback=add_to_callback(&evaluator_callbacks,(callback_func)do_gc,0,0); }while(0)
#define LOW_GC_ALLOC(OBJ) do { \
extern int d_flag; \
......@@ -38,12 +38,12 @@ extern void *gc_svalue_location;
#ifdef ALWAYS_GC
#define GC_ALLOC(OBJ) do{ \
LOW_GC_ALLOC(OBJ); \
if(!gc_evaluator_callback) ADD_GC_CALLBACK(); \
ADD_GC_CALLBACK(); \
} while(0)
#else
#define GC_ALLOC(OBJ) do{ \
LOW_GC_ALLOC(OBJ); \
if(num_allocs == alloc_threshold && !gc_evaluator_callback) \
if(num_allocs == alloc_threshold) \
ADD_GC_CALLBACK(); \
} while(0)
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment