Branch: Tag:

2018-05-19

2018-05-19 14:43:13 by Tobias S. Josefowitz <tobij@tobij.de>

GC: Inline GC marker struct into memory object structs

This avoids unnecessary padding while keeping mostly compatible to most
other users of these structs and markers.

167:   #endif      static struct mapping_data empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, GC_HEADER_INIT(), 0,0,0,0,0,0, 0, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, 0,0,0,0,0,0, 0,    IF_ELSE_KEYPAIR_LOOP((struct keypair *)&empty_data.hash, 0), {0}};   static struct mapping_data weak_ind_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, GC_HEADER_INIT(), 0,0,0,0,0,0, MAPPING_WEAK_INDICES, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, 0,0,0,0,0,0, MAPPING_WEAK_INDICES,    IF_ELSE_KEYPAIR_LOOP((struct keypair *)&weak_ind_empty_data.hash, 0), {0}};   static struct mapping_data weak_val_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, GC_HEADER_INIT(), 0,0,0,0,0,0, MAPPING_WEAK_VALUES, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, 0,0,0,0,0,0, MAPPING_WEAK_VALUES,    IF_ELSE_KEYPAIR_LOOP((struct keypair *)&weak_val_empty_data.hash, 0), {0}};   static struct mapping_data weak_both_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, GC_HEADER_INIT(), 0,0,0,0,0,0, MAPPING_WEAK, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, 0,0,0,0,0,0, MAPPING_WEAK,    IF_ELSE_KEYPAIR_LOOP((struct keypair *)&weak_both_empty_data.hash, 0), {0}};      /*
251:    }    }    add_ref(md); -  gc_init_marker(&md->m); +  gc_init_marker(md);    m->data=md;   #ifdef MAPPING_SIZE_DEBUG    m->debug_size = md->size;
685:       nmd=(struct mapping_data *)xalloc(size);    memcpy(nmd, md, size); -  gc_init_marker(&nmd->m); +  gc_init_marker(nmd);    off=((char *)nmd) - ((char *)md);       RELOC(nmd->free_list);