* include/gc_disclaim.h, fnlz_mlc.c (GC_disclaim_proc, GC_register_disclaim_proc):
Remove CD from typedef and function.
* reclaim.c (GC_reclaim_uninit, GC_reclaim_block): Adjust calls.
* include/private/gc_priv.h, misc.c: Remove CD from object kind struct and
initializers.
STATIC int GC_finalized_kind = 0;
-STATIC int GC_CALLBACK GC_finalized_disclaim(void *obj,
- void *cd GC_ATTR_UNUSED)
+STATIC int GC_CALLBACK GC_finalized_disclaim(void *obj)
{
void **fc_addr;
const struct GC_finalizer_closure *fc;
GC_finalized_objfreelist = (ptr_t *)GC_new_free_list_inner();
GC_finalized_kind = GC_new_kind_inner((void **)GC_finalized_objfreelist,
GC_DS_LENGTH, TRUE, TRUE);
- GC_register_disclaim_proc(GC_finalized_kind, GC_finalized_disclaim,
- NULL, TRUE);
+ GC_register_disclaim_proc(GC_finalized_kind, GC_finalized_disclaim, TRUE);
UNLOCK();
}
GC_API void GC_CALL GC_register_disclaim_proc(int kind, GC_disclaim_proc proc,
- void *cd,
int mark_unconditionally)
{
GC_ASSERT((unsigned)kind < MAXOBJKINDS);
GC_obj_kinds[kind].ok_disclaim_proc = proc;
- GC_obj_kinds[kind].ok_disclaim_cd = cd;
GC_obj_kinds[kind].ok_mark_unconditionally = (GC_bool)mark_unconditionally;
}
/* finalized allocations. The function is thread-safe. */
GC_API void GC_CALL GC_init_finalized_malloc(void);
-/* Type of a disclaim call-back, always stored along with closure data */
-/* passed as the second argument. */
-typedef int (GC_CALLBACK * GC_disclaim_proc)(void * /*obj*/, void * /*cd*/);
+/* Type of a disclaim call-back. */
+typedef int (GC_CALLBACK * GC_disclaim_proc)(void * /*obj*/);
/* Register "proc" to be called on each object of "kind" ready to be */
/* reclaimed. If "proc" returns non-zero, the collector will not */
/* to reclaim. */
GC_API void GC_CALL GC_register_disclaim_proc(int /*kind*/,
GC_disclaim_proc /*proc*/,
- void * /*cd*/,
int /*mark_from_all*/);
/* The finalizer closure used by GC_finalized_malloc. */
/* Mark from all, including unmarked, objects */
/* in block. Used to protect objects reachable */
/* from reclaim notifiers. */
- int (GC_CALLBACK *ok_disclaim_proc)(void * /*obj*/, void * /*cd*/);
- void *ok_disclaim_cd;
+ int (GC_CALLBACK *ok_disclaim_proc)(void * /*obj*/);
/* The disclaim procedure is called before obj */
/* is reclaimed, but must also tolerate being */
/* called with object from freelist. Non-zero */
/* exit prevents object from being reclaimed. */
-# define OK_DISCLAIM_INITZ /* comma */, FALSE, NULL, NULL
+# define OK_DISCLAIM_INITZ /* comma */, FALSE, NULL
# else
# define OK_DISCLAIM_INITZ /* empty */
# endif /* !ENABLE_DISCLAIM */
# ifdef ENABLE_DISCLAIM
GC_obj_kinds[result].ok_mark_unconditionally = FALSE;
GC_obj_kinds[result].ok_disclaim_proc = 0;
- GC_obj_kinds[result].ok_disclaim_cd = NULL;
# endif
return result;
}
word *p, *q, *plim;
signed_word n_bytes_found = 0;
struct obj_kind *ok = &GC_obj_kinds[hhdr->hb_obj_kind];
- int (GC_CALLBACK *proc)(void *, void *) = ok->ok_disclaim_proc;
- void *cd = ok -> ok_disclaim_cd;
+ int (GC_CALLBACK *disclaim)(void *) = ok->ok_disclaim_proc;
GC_ASSERT(sz == hhdr -> hb_sz);
p = (word *)(hbp -> hb_body);
while (p <= plim) {
int marked = mark_bit_from_hdr(hhdr, bit_no);
- if (!marked && (*proc)(p, cd)) {
+ if (!marked && (*disclaim)(p)) {
hhdr -> hb_n_marks++;
marked = 1;
}
# ifdef ENABLE_DISCLAIM
if (EXPECT(hhdr->hb_flags & HAS_DISCLAIM, 0)) {
struct obj_kind *ok = &GC_obj_kinds[hhdr->hb_obj_kind];
- if ((*ok->ok_disclaim_proc)(hbp, ok->ok_disclaim_cd)) {
+ if ((*ok->ok_disclaim_proc)(hbp)) {
/* Not disclaimed => resurrect the object. */
set_mark_bit_from_hdr(hhdr, 0);
goto in_use;