version 1.1, 1999/12/03 07:39:09 |
version 1.2, 2000/04/10 08:31:30 |
Line 343 void GC_start_debugging() |
|
Line 343 void GC_start_debugging() |
|
} |
} |
|
|
# ifdef GC_ADD_CALLER |
# ifdef GC_ADD_CALLER |
# define EXTRA_ARGS word ra, char * s, int i |
# define EXTRA_ARGS word ra, CONST char * s, int i |
# define OPT_RA ra, |
# define OPT_RA ra, |
# else |
# else |
# define EXTRA_ARGS char * s, int i |
# define EXTRA_ARGS CONST char * s, int i |
# define OPT_RA |
# define OPT_RA |
# endif |
# endif |
|
|
|
|
GC_PTR p; |
GC_PTR p; |
# endif |
# endif |
{ |
{ |
register GC_PTR base = GC_base(p); |
register GC_PTR base; |
register ptr_t clobbered; |
register ptr_t clobbered; |
|
|
|
if (0 == p) return; |
|
base = GC_base(p); |
if (base == 0) { |
if (base == 0) { |
GC_err_printf1("Attempt to free invalid pointer %lx\n", |
GC_err_printf1("Attempt to free invalid pointer %lx\n", |
(unsigned long)p); |
(unsigned long)p); |
if (p != 0) ABORT("free(invalid pointer)"); |
ABORT("free(invalid pointer)"); |
} |
} |
if ((ptr_t)p - (ptr_t)base != sizeof(oh)) { |
if ((ptr_t)p - (ptr_t)base != sizeof(oh)) { |
GC_err_printf1( |
GC_err_printf1( |
|
|
/* Invalidate size */ |
/* Invalidate size */ |
((oh *)base) -> oh_sz = GC_size(base); |
((oh *)base) -> oh_sz = GC_size(base); |
} |
} |
# ifdef FIND_LEAK |
if (GC_find_leak) { |
GC_free(base); |
GC_free(base); |
# else |
} else { |
{ |
register hdr * hhdr = HDR(p); |
register hdr * hhdr = HDR(p); |
GC_bool uncollectable = FALSE; |
GC_bool uncollectable = FALSE; |
|
|
|
if (hhdr -> hb_obj_kind == UNCOLLECTABLE) { |
if (hhdr -> hb_obj_kind == UNCOLLECTABLE) { |
uncollectable = TRUE; |
uncollectable = TRUE; |
} |
|
# ifdef ATOMIC_UNCOLLECTABLE |
|
if (hhdr -> hb_obj_kind == AUNCOLLECTABLE) { |
|
uncollectable = TRUE; |
|
} |
|
# endif |
|
if (uncollectable) GC_free(base); |
|
} |
} |
# endif |
# ifdef ATOMIC_UNCOLLECTABLE |
|
if (hhdr -> hb_obj_kind == AUNCOLLECTABLE) { |
|
uncollectable = TRUE; |
|
} |
|
# endif |
|
if (uncollectable) GC_free(base); |
|
} /* !GC_find_leak */ |
} |
} |
|
|
# ifdef __STDC__ |
# ifdef __STDC__ |