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.131 2001/08/22 14:10:59 grubba Exp $"); + RCSID("$Id: mapping.c,v 1.132 2001/09/01 01:45:51 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:157:    INT32 hashsize;       debug_malloc_touch(m);   #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK)    fatal("Can't allocate a new mapping_data inside gc.\n");    if(size < 0) fatal("init_mapping with negative value.\n");   #endif    if(size)    { -  hashsize=size / AVG_LINK_LENGTH + 1; -  if(!(hashsize & 1)) hashsize++; +  hashsize=find_good_hash_size(size / AVG_LINK_LENGTH + 1);       e=MAPPING_DATA_SIZE(hashsize, size);       md=(struct mapping_data *)xalloc(e);       m->data=md;    md->hashsize=hashsize;       MEMSET((char *)md->hash, 0, sizeof(struct keypair *) * md->hashsize);