pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:232:    default: md = &weak_both_empty_data; break;    }    }    add_ref(md);    m->data=md;   #ifdef MAPPING_SIZE_DEBUG    m->debug_size = md->size;   #endif   }    - static struct mapping *allocate_mapping_no_init(int size) + static struct mapping *allocate_mapping_no_init(void)   {    struct mapping *m=alloc_mapping();    GC_ALLOC(m);    m->refs = 0;    add_ref(m); /* For DMALLOC... */    DOUBLELINK(first_mapping, m);    return m;   }      /** This function allocates an empty mapping with initial room    * for 'size' values.    *    * @param size initial number of values    * @return the newly allocated mapping    * @see do_free_mapping    * @see free_mapping    */   PMOD_EXPORT struct mapping *debug_allocate_mapping(int size)   { -  struct mapping *m = allocate_mapping_no_init(size); +  struct mapping *m = allocate_mapping_no_init();    init_mapping(m,size,0);    return m;   }      PMOD_EXPORT void really_free_mapping_data(struct mapping_data *md)   {    INT32 e;    struct keypair *k;    debug_malloc_touch(md);   
pike.git/src/mapping.c:1548:   /* deferred mapping copy! */   PMOD_EXPORT struct mapping *copy_mapping(struct mapping *m)   {    struct mapping *n;      #ifdef PIKE_DEBUG    if(m->data->refs <=0)    Pike_fatal("Zero refs in mapping->data\n");   #endif    -  n=allocate_mapping_no_init(0); +  n=allocate_mapping_no_init();    n->data=m->data;   #ifdef MAPPING_SIZE_DEBUG    n->debug_size=n->data->size;   #endif    add_ref(n->data);    n->data->valrefs++;    n->data->hardlinks++;    debug_malloc_touch(n->data);    return n;   }