2000-01-28
2000-01-28 21:00:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
765de03a71442f577db0fc92e06a62bd6286f882
(61 lines)
(+37/-24)
[
Show
| Annotate
]
Branch: 7.9
Added some more PIKE_DEBUG/DMALLOC_DEBUG.
Fixed a few minor typos.
Added minor FIXME regarding Muse of MAPPING_LOOP().
Rev: src/mapping.c:1.51
5:
\*/
/**/
#include "global.h"
- RCSID("$Id: mapping.c,v 1.50 2000/01/28 00:46:26 hubbe Exp $");
+ RCSID("$Id: mapping.c,v 1.51 2000/01/28 21:00:44 grubba Exp $");
#include "main.h"
#include "object.h"
#include "mapping.h"
184:
INT32 e;
struct keypair *k;
debug_malloc_touch(md);
+ #ifdef PIKE_DEBUG
+ if (md->refs) {
+ fatal("really_free_mapping_data(): md has non-zero refs: %d\n",
+ md->refs);
+ }
+ #endif /* PIKE_DEBUG */
NEW_MAPPING_LOOP(md)
{
free_svalue(& k->val);
231: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(d_flag>1) check_mapping(m);
#endif
242:
md=m->data;
if(md->refs>1)
{
+ debug_malloc_touch(md);
md=m->data=copy_mapping_data(m->data);
debug_malloc_touch(md);
}
481: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
h2=hash_svalue(key);
571: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(d_flag>1) check_mapping(m);
671: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(d_flag>1) check_mapping(m);
#endif
741: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(d_flag>1) check_mapping(m);
#endif
796: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(d_flag>1) check_mapping(m);
#endif
863: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
if(!s || !s->type==T_MAPPING)
938: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
a=allocate_array(m->data->size);
965: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
a=allocate_array(m->data->size);
992: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
a=allocate_array(m->data->size);
1021: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
md=m->data;
1092: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
n=allocate_mapping(0);
-
+ debug_malloc_touch(n->data);
free_mapping_data(n->data);
n->data=m->data;
n->data->refs++;
n->data->valrefs++;
n->data->hardlinks++;
-
+ debug_malloc_touch(n->data);
return n;
}
1116: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(a->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(b->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
ai=mapping_indices(a);
1198: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(a->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
if(b->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
if(a==b) return 1;
1253: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
if(! m->data->size)
1312:
my_strcat("])");
}
- node * make_node_from_mapping(struct mapping *m)
+ node *make_node_from_mapping(struct mapping *m)
{
struct keypair *k;
INT32 e;
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
mapping_fix_type_field(m);
1392: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
doing.next=p;
1418:
md=m->data;
md->valrefs++;
add_ref(md);
- MAPPING_LOOP(m)
+ MAPPING_LOOP(m) /* FIXME: Shouldn't NEW_MAPPING_LOOP() be used? */
{
copy_svalues_recursively_no_free(sp,&k->ind, 1, p);
sp++;
1444: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
md=m->data;
1525: Inside #if defined(PIKE_DEBUG)
if(!m->data)
fatal("Mapping has no data block.\n");
+ if (!m->data->refs)
+ fatal("Mapping data block has zero refs.\n");
+
if(m->next && m->next->prev != m)
fatal("Mapping ->next->prev != mapping.\n");
1605: Inside #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(m->data->refs <=0)
- fatal("Zero refs i mapping->data\n");
+ fatal("Zero refs in mapping->data\n");
#endif
if(gc_mark(m))