Branch: Tag:

2004-04-18

2004-04-18 02:16:06 by Martin Stjernholm <mast@lysator.liu.se>

Improved debug during cleanup: If there are internal refs that the gc don't
know about it will free them during the leak report. When they then are
freed from their real places later on, they will run out of refs. Therefore
the debug now prints all locations the leaked objects are freed from.

Rev: src/array.h:1.59
Rev: src/dmalloc.h:1.50
Rev: src/gc.c:1.253
Rev: src/gc.h:1.112
Rev: src/main.c:1.200
Rev: src/mapping.h:1.54
Rev: src/multiset.h:1.34
Rev: src/object.h:1.82
Rev: src/program.c:1.563
Rev: src/program.h:1.202

2:   || 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: mapping.h,v 1.53 2004/03/22 19:35:44 mast Exp $ + || $Id: mapping.h,v 1.54 2004/04/18 02:16:06 mast Exp $   */      #ifndef MAPPING_H
82:    for(((k = MD_KEYPAIRS((m)->data, (m)->data->hashsize)), e=0) DO_IF_DMALLOC( ?0:(debug_malloc_touch(m),debug_malloc_touch((m)->data)) ) ; e<(m)->data->size; e++,k++)   #endif /* PIKE_MAPPING_KEYPAIR_LOOP */    - #define free_mapping(M) do{ struct mapping *m_=(M); debug_malloc_touch(m_); if(!sub_ref(m_)) really_free_mapping(m_); }while(0) + #define free_mapping(M) do{ \ +  struct mapping *m_=(M); \ +  debug_malloc_touch(m_); \ +  DO_IF_PIKE_CLEANUP ( \ +  if (gc_external_refs_zapped) \ +  gc_check_zapped (m_, PIKE_T_MAPPING, __FILE__, __LINE__); \ +  ); \ +  if(!sub_ref(m_)) \ +  really_free_mapping(m_); \ +  }while(0)      #define free_mapping_data(M) do{ \    struct mapping_data *md_=(M); \