diff --git a/src/modules/call_out/call_out.c b/src/modules/call_out/call_out.c index d508736c673088a0de4b368e2462056f0a47b6d0..c562c29c7fc6bbce3a377c1d650748ed02881311 100644 --- a/src/modules/call_out/call_out.c +++ b/src/modules/call_out/call_out.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: call_out.c,v 1.14 1997/10/23 03:15:41 hubbe Exp $"); +RCSID("$Id: call_out.c,v 1.15 1997/10/23 03:53:21 hubbe Exp $"); #include "array.h" #include "dynamic_buffer.h" #include "object.h" @@ -18,6 +18,7 @@ RCSID("$Id: call_out.c,v 1.14 1997/10/23 03:15:41 hubbe Exp $"); #include "constants.h" #include "stralloc.h" #include "builtin_functions.h" +#include "gc.h" #include "callback.h" @@ -263,6 +264,17 @@ static struct callback *call_out_backend_callback=0; static struct callback *mem_callback=0; void do_call_outs(struct callback *ignored, void *ignored_too, void *arg); +static void mark_call_outs(struct callback *foo, void *bar, void *gazonk) +{ + int e; + for(e=0;e<num_pending_calls;e++) + { + gc_external_mark(CALL(e).args); + if(CALL(e).caller) + gc_external_mark(CALL(e).caller); + } +} + void f_call_out(INT32 args) { struct svalue tmp; @@ -288,13 +300,17 @@ void f_call_out(INT32 args) call_out_backend_callback=add_backend_callback(do_call_outs,0,0); if(!mem_callback) + { mem_callback=add_memory_usage_callback(count_memory_in_call_outs,0,0); + add_gc_callback(mark_call_outs, 0, 0); + } #ifdef DEBUG if(!verify_call_out_callback) verify_call_out_callback=add_to_callback(& do_debug_callbacks, do_verify_call_outs, 0, 0); #endif + } void do_call_outs(struct callback *ignored, void *ignored_too, void *arg)