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.42 1999/10/20 01:44:38 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.43 1999/10/29 00:07:19 hubbe 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:514:   }      struct svalue *mapping_mapping_lookup(struct mapping *m,    struct svalue *key1,    struct svalue *key2,    int create)   {    struct svalue tmp;    struct mapping *m2;    struct svalue *s=low_mapping_lookup(m, key1); +  debug_malloc_touch(m);       if(!s || !s->type==T_MAPPING)    {    if(!create) return 0;    tmp.u.mapping=allocate_mapping(5);    tmp.type=T_MAPPING;    mapping_insert(m, key1, &tmp); -  +  debug_malloc_touch(m); +  debug_malloc_touch(tmp.u.mapping); +  free_mapping(tmp.u.mapping); /* There is one ref in 'm' */    s=&tmp;    }       m2=s->u.mapping; -  +  debug_malloc_touch(m2);    s=low_mapping_lookup(m2, key2);    if(s) return s;    if(!create) return 0;       tmp.type=T_INT;    tmp.subtype=NUMBER_UNDEFINED;    tmp.u.integer=0;       mapping_insert(m2, key2, &tmp); -  +  debug_malloc_touch(m2);       return low_mapping_lookup(m2, key2);   }         struct svalue *mapping_mapping_string_lookup(struct mapping *m,    struct pike_string *key1,    struct pike_string *key2,    int create)   {