Esempio n. 1
0
static
CLEAR_MARKS_PROC(change_clear_marks)
{
    alloc_change_t *const ptr = (alloc_change_t *)vptr;

    if (r_is_packed(&ptr->contents))
        r_clear_pmark((ref_packed *) & ptr->contents);
    else
        r_clear_attrs(&ptr->contents, l_mark);
}
Esempio n. 2
0
} RELOC_PTRS_END

/* ------ Unmarking phase ------ */

/* Unmark a single ref. */
void
ptr_ref_unmark(enum_ptr_t *pep, gc_state_t * ignored)
{
    ref_packed *rpp = (ref_packed *)pep->ptr;

    if (r_is_packed(rpp))
	r_clear_pmark(rpp);
    else
	r_clear_attrs((ref *)rpp, l_mark);
}
Esempio n. 3
0
/* Unmarking routine for ref objects. */
static void
refs_clear_marks(const gs_memory_t *cmem, 
		 void /*obj_header_t */ *vptr, uint size,
		 const gs_memory_struct_type_t * pstype)
{
    ref_packed *rp = (ref_packed *) vptr;
    ref_packed *end = (ref_packed *) ((byte *) vptr + size);

    /* Since the last ref is full-size, we only need to check for */
    /* the end of the block when we see one of those. */
    for (;;) {
	if (r_is_packed(rp)) {
#ifdef DEBUG
	    if (gs_debug_c('8')) {
		dlprintf1("  [8]unmark packed 0x%lx ", (ulong) rp);
		debug_print_ref(cmem, (const ref *)rp);
		dputs("\n");
	    }
#endif
	    r_clear_pmark(rp);
	    rp++;
	} else {		/* full-size ref */
	    ref *const pref = (ref *)rp;

#ifdef DEBUG
	    if (gs_debug_c('8')) {
		dlprintf1("  [8]unmark ref 0x%lx ", (ulong) rp);
		debug_print_ref(cmem, pref);
		dputs("\n");
	    }
#endif
	    r_clear_attrs(pref, l_mark);
	    rp += packed_per_ref;
	    if (rp >= (ref_packed *) end)
		break;
	}
    }
}