pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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: pike_types.c,v 1.210 2003/03/08 20:38:02 grubba Exp $ + || $Id: pike_types.c,v 1.211 2003/03/14 15:50:46 grubba Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.210 2003/03/08 20:38:02 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.211 2003/03/14 15:50:46 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:213:    */   #define PIKE_TYPE_CHUNK 128   BLOCK_ALLOC(pike_type, PIKE_TYPE_CHUNK)      static struct pike_type **pike_type_hash = NULL;   static size_t pike_type_hash_size = 0;      void debug_free_type(struct pike_type *t)   {    loop: -  if (!(--(((struct pike_type *)debug_malloc_pass(t))->refs))) { +  if (!sub_ref(t)) {    unsigned INT32 hash = t->hash % pike_type_hash_size;    struct pike_type **t2 = pike_type_hash + hash;    struct pike_type *car, *cdr;    unsigned INT32 type;       while (*t2) {    if (*t2 == t) {    *t2 = t->next;    break;    }
pike.git/src/pike_types.c:384:    break;   #endif /* PIKE_DEBUG */    }    add_ref((struct pike_type *)debug_malloc_pass(t));    return t;    }    }       debug_malloc_pass(t = alloc_pike_type());    -  t->refs = 1; +  t->refs = 0; +  add_ref(t); /* For DMALLOC... */    t->type = type;    t->flags = 0;    t->car = car;    t->cdr = cdr;       t->hash = hash;    t->next = pike_type_hash[index];    pike_type_hash[index] = t;       if (flag_method) {