diff --git a/src/module.c b/src/module.c index 0d2aca00c790f2479ccbf677ec39acaf6ebeadc2..2660ed3f38d62d6c84c5928bc9055ee31e8c85b7 100644 --- a/src/module.c +++ b/src/module.c @@ -2,7 +2,7 @@ || 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: module.c,v 1.60 2010/05/31 13:59:05 grubba Exp $ +|| $Id: module.c,v 1.61 2010/07/19 15:49:24 mast Exp $ */ #include "global.h" @@ -58,6 +58,18 @@ static void init_builtin_modules(void) void init_facetgroup(void); #endif +#ifdef DEBUG_MALLOC + /* Make some statically allocated structs known to dmalloc. These + * will still show up in the DO_PIKE_CLEANUP leak report if they + * leak, in spite of dmalloc_accept_leak. */ + dmalloc_register (&empty_array, sizeof (empty_array), + DMALLOC_LOCATION()); + dmalloc_accept_leak (&empty_array); + dmalloc_register (&weak_empty_array, sizeof (weak_empty_array), + DMALLOC_LOCATION()); + dmalloc_accept_leak (&weak_empty_array); +#endif + TRACE((stderr, "Init cpp...\n")); init_cpp(); diff --git a/src/multiset.c b/src/multiset.c index fe867c945afd7c0b8615d94b88dea216ec9a2d4b..6d28e68d936f2b24a75e39a786d002b12fb88697 100644 --- a/src/multiset.c +++ b/src/multiset.c @@ -2,7 +2,7 @@ || 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: multiset.c,v 1.121 2010/07/11 19:12:02 mast Exp $ +|| $Id: multiset.c,v 1.122 2010/07/19 15:49:25 mast Exp $ */ #include "global.h" @@ -4389,6 +4389,17 @@ void init_multiset() test.i.ind.type); #undef msnode_check #endif + +#ifdef DEBUG_MALLOC + /* Make some statically allocated structs known to dmalloc. */ + dmalloc_register (&empty_ind_msd, sizeof (empty_ind_msd), + DMALLOC_LOCATION()); + dmalloc_accept_leak (&empty_ind_msd); + dmalloc_register (&empty_indval_msd, sizeof (empty_indval_msd), + DMALLOC_LOCATION()); + dmalloc_accept_leak (&empty_indval_msd); +#endif + init_multiset_blocks(); }