pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: mapping.c,v 1.205 2008/06/25 17:48:10 grubba Exp $ + || $Id: mapping.c,v 1.206 2008/06/26 09:30:49 grubba Exp $   */      #include "global.h"   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"
pike.git/src/mapping.c:408:       md=m->data;    debug_malloc_touch(md);   #ifdef PIKE_DEBUG    if(md->refs <=0)    Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   #endif    +  if (md->hashsize == new_size) return m; +     init_mapping(m, new_size, md->flags);    debug_malloc_touch(m);    new_md=m->data;    new_md->generation_cnt = md->generation_cnt;       /* This operation is now 100% atomic - no locking required */    if(md->refs>1)    {    /* good */    for(e=0;e<md->hashsize;e++)
pike.git/src/mapping.c:1002: Inside #if defined(MAPPING_SIZE_DEBUG)
   md->size--;   #ifdef MAPPING_SIZE_DEBUG    if(m->data ==md)    m->debug_size--;   #endif       if(md->size < (md->hashsize + 1) * MIN_LINK_LENGTH)    {    debug_malloc_touch(m);    rehash(m, MAP_SLOTS(m->data->size + !!md->generation_cnt)); +  if (m->data->hashsize) +  m->data->flags |= MAPPING_DIRTY;    } -  +  else +  md->flags |= MAPPING_DIRTY;    -  /* Note: md may be invalid here dure to the rehash above. */ -  m->data->flags |= MAPPING_DIRTY; -  +    #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);   #endif    return;   }      PMOD_EXPORT void check_mapping_for_destruct(struct mapping *m)   {    INT32 e;    struct keypair *k, **prev;