pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:160: Inside #if defined(PIKE_DEBUG)
      if(val_types & ~(m->data->val_types))    Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types))    Pike_fatal("Mapping indices types out of order!\n");   }   #endif      static struct mapping_data empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), 1, 0,0,0,0,0,0, 0, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), GC_HEADER_INIT(), 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, 0,0,0,0,0,0, MAPPING_WEAK_INDICES, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), GC_HEADER_INIT(), 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, 0,0,0,0,0,0, MAPPING_WEAK_VALUES, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), GC_HEADER_INIT(), 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, 0,0,0,0,0,0, MAPPING_WEAK, +  { PIKE_CONSTANT_MEMOBJ_INIT(1, T_MAPPING_DATA), GC_HEADER_INIT(), 1, 0,0,0,0,0,0, MAPPING_WEAK,    IF_ELSE_KEYPAIR_LOOP((struct keypair *)&weak_both_empty_data.hash, 0), {0}};      /*    * This rounds an integer up to the next power of two. For x a power    * of two, this will just return the same again.    */   static unsigned INT32 find_next_power(unsigned INT32 x)   {    if( x == 0 ) return 1;    return 1<<(my_log2(x-1)+1);
pike.git/src/mapping.c:244:    md->num_keypairs=size;    }else{    switch (flags & MAPPING_WEAK) {    case 0: md = &empty_data; break;    case MAPPING_WEAK_INDICES: md = &weak_ind_empty_data; break;    case MAPPING_WEAK_VALUES: md = &weak_val_empty_data; break;    default: md = &weak_both_empty_data; break;    }    }    add_ref(md); +  gc_init_marker(&md->m);    m->data=md;   #ifdef MAPPING_SIZE_DEBUG    m->debug_size = md->size;   #endif   }      static struct mapping *allocate_mapping_no_init(void)   {    struct mapping *m=alloc_mapping();    GC_ALLOC(m);
pike.git/src/mapping.c:677: Inside #if defined(PIKE_DEBUG)
   if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK)    Pike_fatal("Can't allocate a new mapping_data inside gc.\n");   #endif       debug_malloc_touch(md);       size=MAPPING_DATA_SIZE(md->hashsize, md->num_keypairs);       nmd=(struct mapping_data *)xalloc(size);    memcpy(nmd, md, size); +  gc_init_marker(&nmd->m);    off=((char *)nmd) - ((char *)md);       RELOC(nmd->free_list);    for(e=0;e<nmd->hashsize;e++) RELOC(nmd->hash[e]);       keypairs=MD_KEYPAIRS(nmd, nmd->hashsize);   #ifndef PIKE_MAPPING_KEYPAIR_LOOP    for(e=0;e<nmd->num_keypairs;e++)    {    RELOC(keypairs[e].next);