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.168 2003/06/30 17:06:09 mast Exp $ + || $Id: mapping.c,v 1.169 2003/08/20 12:04:51 grubba Exp $   */      #include "global.h" - RCSID("$Id: mapping.c,v 1.168 2003/06/30 17:06:09 mast Exp $"); + RCSID("$Id: mapping.c,v 1.169 2003/08/20 12:04:51 grubba 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:608: Inside #if defined(PIKE_DEBUG)
   if(ind_types & ~(m->data->ind_types))    Pike_fatal("Mapping indices types out of order!\n");   #endif    m->data->val_types = val_types;    m->data->ind_types = ind_types;   }      PMOD_EXPORT void mapping_set_flags(struct mapping *m, int flags)   {    struct mapping_data *md = m->data; -  if (md->refs > 1) { +  +  if ((md->flags != flags) && (md->refs > 1)) {    struct keypair *k = NULL, *prev = NULL;    COPYMAP2(); -  +  md = m->data;    }   #ifdef PIKE_DEBUG    if(flags & MAPPING_WEAK)    {    debug_malloc_touch(m);    debug_malloc_touch(md);    }    else    {    debug_malloc_touch(m);
pike.git/src/mapping.c:1330:   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(0); -  if(!m_sizeof(m)) return n; /* done */ +     debug_malloc_touch(n->data);    free_mapping_data(n->data);    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);
pike.git/src/mapping.c:1560: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(a->data->refs <=0)    Pike_fatal("Zero refs in mapping->data\n");    if(b->data->refs <=0)    Pike_fatal("Zero refs in mapping->data\n");   #endif       if(a==b) return 1;    +  if (a->data == b->data) return 1; +  +  if (a->data->flags || b->data->flags) return 0; +     check_mapping_for_destruct(a);    check_mapping_for_destruct(b);       if(m_sizeof(a) != m_sizeof(b)) return 0;       curr.pointer_a = a;    curr.pointer_b = b;    curr.next = p;       for( ;p ;p=p->next)