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.87 2000/06/20 03:26:16 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.88 2000/07/03 16:50:09 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:833:    INT32 e;    struct keypair *k, **prev;    TYPE_FIELD ind_types, val_types;    struct mapping_data *md=m->data;      #ifdef PIKE_DEBUG    if(m->data->refs <=0)    fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m); +  if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc != GC_PASS_MARK) +  fatal("check_mapping_for_destruct called in wrong pass inside gc.\n");   #endif       /* no is_eq -> no locking */       if(!md->size) return;       if((md->ind_types | md->val_types) & (BIT_OBJECT | BIT_FUNCTION))    {    val_types = ind_types = 0;    md->val_types |= BIT_INT;
pike.git/src/mapping.c:1864:   {    INT32 e;    struct keypair *k;      #ifdef PIKE_DEBUG    if(m->data->refs <=0)    fatal("Zero refs in mapping->data\n");   #endif       if(gc_mark(m)) { +  check_mapping_for_destruct(m);    if (m == gc_mark_mapping_pos)    gc_mark_mapping_pos = m->next;    if (m == gc_internal_mapping)    gc_internal_mapping = m->next;    else {    DOUBLEUNLINK(first_mapping, m);    DOUBLELINK(first_mapping, m); /* Linked in first. */    }       if(gc_mark(m->data) &&
pike.git/src/mapping.c:1964:    */    if(((1 << k->ind.type) & (BIT_OBJECT | BIT_FUNCTION)) &&    !(k->ind.u.object->prog))    continue;       debug_gc_check_svalues(&k->ind, 1, T_MAPPING, m);    m->data->val_types |=    debug_gc_check_svalues(&k->val, 1, T_MAPPING, m);    }    } -  -  check_mapping_for_destruct(m); +     }   }      #ifdef PIKE_DEBUG   unsigned gc_touch_all_mappings(void)   {    unsigned n = 0;    struct mapping *m;    if (first_mapping && first_mapping->prev)    fatal("Error in mapping link list.\n");
pike.git/src/mapping.c:2015:   }      void gc_mark_all_mappings(void)   {    gc_mark_mapping_pos = gc_internal_mapping;    while (gc_mark_mapping_pos) {    struct mapping *m = gc_mark_mapping_pos;    gc_mark_mapping_pos = m->next;    if(gc_is_referenced(m))    gc_mark_mapping_as_referenced(m); +  else +  /* Done in gc_mark_mapping_as_referenced() otherwise (and it has +  * to be done there). */ +  check_mapping_for_destruct(m);    }   }      void gc_cycle_check_all_mappings(void)   {    struct mapping *m;    for (m = gc_internal_mapping; m; m = m->next) {    real_gc_cycle_check_mapping(m);    run_lifo_queue(&gc_mark_queue);    }