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.78 2000/04/20 01:49:43 mast Exp $"); + RCSID("$Id: mapping.c,v 1.79 2000/04/23 03:01:25 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:56:    \    unlink_mapping_data(m->data); \    \    if(m->prev) \    m->prev->next = m->next; \    else \    first_mapping = m->next; \    \    if(m->next) m->next->prev = m->prev; \    \ -  GC_FREE(m); +  GC_FREE();         #undef COUNT_OTHER      #define COUNT_OTHER() do{ \    struct mapping *m; \    for(m=first_mapping;m;m=m->next) \    { \    num++; \    size+=MAPPING_DATA_SIZE(m->data->hashsize, m->data->num_keypairs); \
pike.git/src/mapping.c:163:    m->debug_size = md->size;   #endif   }      /* This function allocates an empty mapping with room for 'size' values    */   struct mapping *debug_allocate_mapping(int size)   {    struct mapping *m;    -  GC_ALLOC(); -  +     m=alloc_mapping();    -  +  GC_ALLOC(m); +     INITIALIZE_PROT(m);    init_mapping(m,size);       m->next = first_mapping;    m->prev = 0;    m->refs = 1;    m->flags = 0;       if(first_mapping) first_mapping->prev = m;    first_mapping=m;
pike.git/src/mapping.c:1871:    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);    }    }   }    + #ifdef PIKE_DEBUG + INT32 gc_touch_all_mappings(void) + { +  INT32 n = 0; +  struct mapping *m; +  for (m = first_mapping; m; m = m->next) { +  debug_gc_touch(m); +  n++; +  } +  return n; + } + #endif +    void gc_check_all_mappings(void)   {    struct mapping *m;       for(m=first_mapping;m;m=m->next)    {   #ifdef DEBUG_MALLOC    if (((int)m->data) == 0x55555555) {    fprintf(stderr, "** Zapped mapping in list of active mappings!\n");    describe_something(m, T_MAPPING, 0,2,0);