Use bdwgc macros to allow memory debug.

This commit is contained in:
Fabrizio Fabbri 2017-09-10 23:35:38 -04:00
parent 612eeb5ed1
commit bc522801a9
No known key found for this signature in database
GPG key ID: 8276EDF3D10E6C35
4 changed files with 10 additions and 9 deletions

View file

@ -1160,7 +1160,7 @@ wrapped_finalizer(cl_object o, cl_object finalizer)
*/
GC_finalization_proc ofn;
void *odata;
GC_register_finalizer_no_order(cl_list(2,o,finalizer),
GC_REGISTER_FINALIZER_NO_ORDER(cl_list(2,o,finalizer),
(GC_finalization_proc)deferred_finalizer, 0,
&ofn, &odata);
return;
@ -1183,7 +1183,7 @@ si_get_finalizer(cl_object o)
GC_finalization_proc ofn;
void *odata;
ecl_disable_interrupts_env(the_env);
GC_register_finalizer_no_order(o, (GC_finalization_proc)0, 0, &ofn, &odata);
GC_REGISTER_FINALIZER_NO_ORDER(o, (GC_finalization_proc)0, 0, &ofn, &odata);
if (ofn == 0) {
output = ECL_NIL;
} else if (ofn == (GC_finalization_proc)wrapped_finalizer) {
@ -1191,7 +1191,7 @@ si_get_finalizer(cl_object o)
} else {
output = ECL_NIL;
}
GC_register_finalizer_no_order(o, ofn, odata, &ofn, &odata);
GC_REGISTER_FINALIZER_NO_ORDER(o, ofn, odata, &ofn, &odata);
ecl_enable_interrupts_env(the_env);
@(return output);
}
@ -1202,12 +1202,12 @@ ecl_set_finalizer_unprotected(cl_object o, cl_object finalizer)
GC_finalization_proc ofn;
void *odata;
if (finalizer == ECL_NIL) {
GC_register_finalizer_no_order(o, (GC_finalization_proc)0,
GC_REGISTER_FINALIZER_NO_ORDER(o, (GC_finalization_proc)0,
0, &ofn, &odata);
} else {
GC_finalization_proc newfn;
newfn = (GC_finalization_proc)wrapped_finalizer;
GC_register_finalizer_no_order(o, newfn, finalizer,
GC_REGISTER_FINALIZER_NO_ORDER(o, newfn, finalizer,
&ofn, &odata);
}
}
@ -1431,7 +1431,7 @@ ecl_alloc_weak_pointer(cl_object o)
obj->t = t_weak_pointer;
obj->value = o;
if (!ECL_FIXNUMP(o) && !ECL_CHARACTERP(o) && !Null(o)) {
GC_general_register_disappearing_link((void**)&(obj->value), (void*)o);
GC_GENERAL_REGISTER_DISAPPEARING_LINK((void**)&(obj->value), (void*)o);
si_set_finalizer((cl_object)obj, ECL_T);
}
return (cl_object)obj;

View file

@ -162,6 +162,7 @@ static cl_object si_simple_toplevel ()
ecl_prin1(sentence, output);
}
} ECL_CATCH_ALL_END;
@(return);
}
int

View file

@ -2383,8 +2383,8 @@ eval_nontrivial_form(cl_env_ptr env, cl_object form) {
new_c_env.lex_env,
bytecodes);
#ifdef GBC_BOEHM
GC_free(bytecodes->bytecodes.code);
GC_free(bytecodes);
GC_FREE(bytecodes->bytecodes.code);
GC_FREE(bytecodes);
#endif
}
env->c_env = old_c_env;

View file

@ -5268,7 +5268,7 @@ file_listen(cl_object stream, int fileno)
unlikely_if (!GetConsoleMode(hnd, &cm))
FEwin32_error("GetConsoleMode() failed", 0);
if (dw > 0) {
PINPUT_RECORD recs = (PINPUT_RECORD)GC_malloc(sizeof(INPUT_RECORD)*dw);
PINPUT_RECORD recs = (PINPUT_RECORD)GC_MALLOC(sizeof(INPUT_RECORD)*dw);
int i;
unlikely_if (!PeekConsoleInput(hnd, recs, dw, &dw_read))
FEwin32_error("PeekConsoleInput failed()", 0);