pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.103 2000/09/08 17:31:26 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.104 2000/09/14 15:23:41 mast Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:190:       return m;   }         PMOD_EXPORT void really_free_mapping_data(struct mapping_data *md)   {    INT32 e;    struct keypair *k;    debug_malloc_touch(md); +    #ifdef PIKE_DEBUG -  +  if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) +  fatal("Can't free a mapping_data inside gc.\n"); +     if (md->refs) {    fatal("really_free_mapping_data(): md has non-zero refs: %d\n",    md->refs);    }   #endif /* PIKE_DEBUG */ -  +     NEW_MAPPING_LOOP(md)    {    free_svalue(& k->val);    free_svalue(& k->ind);    }       free((char *) md);   }      PMOD_EXPORT void do_free_mapping(struct mapping *m)
pike.git/src/mapping.c:299:    INT32 tmp=m->data->size;   #endif    INT32 e;       md=m->data;    debug_malloc_touch(md);   #ifdef PIKE_DEBUG    if(md->refs <=0)    fatal("Zero refs in mapping->data\n");    +  if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) +  fatal("Can't rehash a mapping inside gc.\n"); +     if(d_flag>1) check_mapping(m);   #endif       init_mapping(m, new_size);    debug_malloc_touch(m);    new_md=m->data;    new_md->flags = md->flags;       /* This operation is now 100% atomic - no locking required */    if(md->refs>1)