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.46 1999/11/12 07:34:31 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.47 1999/11/23 10:38:16 mast Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "language.h"   #include "error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"
pike.git/src/mapping.c:1094:    /* We do not want to count this key:index pair if    * the index is a destructed object or function    */    if(((1 << k->ind.type) & (BIT_OBJECT | BIT_FUNCTION)) &&    !(k->ind.u.object->prog))    continue;       if (m->flags & MAPPING_FLAG_WEAK)    {    if (k->ind.type == T_OBJECT && -  k->ind.u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) +  k->ind.u.object->prog->flags & PROGRAM_NO_WEAK_FREE)    gc_mark_svalues(&k->ind, 1);    if (k->val.type == T_OBJECT && k->val.u.object->prog && -  k->val.u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) +  k->val.u.object->prog->flags & PROGRAM_NO_WEAK_FREE)    gc_mark_svalues(&k->val, 1);    }    else {    gc_mark_svalues(&k->ind, 1);    gc_mark_svalues(&k->val, 1);    }    }    }    }   }
pike.git/src/mapping.c:1195:    }    else if(m->flags & MAPPING_FLAG_WEAK)    {    add_ref(m);    for(e=0;e<m->hashsize;e++)    {    for(prev= m->hash + e;(k=*prev);)    {    if((k->val.type <= MAX_COMPLEX &&    !(k->val.type == T_OBJECT && -  k->val.u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  k->val.u.object->prog->flags & PROGRAM_NO_WEAK_FREE) &&    gc_do_free(k->val.u.refs)) ||    (k->ind.type <= MAX_COMPLEX &&    !(k->ind.type == T_OBJECT && -  k->ind.u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  k->ind.u.object->prog->flags & PROGRAM_NO_WEAK_FREE) &&    gc_do_free(k->ind.u.refs)))    {    *prev=k->next;    free_svalue(& k->ind);    free_svalue(& k->val);    k->next=m->free_list;    m->free_list=k;    m->size--;    }else{    prev=&k->next;