2008-05-02
2008-05-02 04:15:18 by Martin Stjernholm <mast@lysator.liu.se>
-
ad8d058d40a36fc616c50076f3d7790bc2c33418
(13 lines)
(+11/-2)
[
Show
| Annotate
]
Branch: 7.9
Added Pike.count_memory to be able to see the memory consumed by arbitrary
pike structures.
The Gmp classes have been fixed to accurately report sizes, but there's
probably more to do in other modules.
Rev: lib/modules/Pike.pmod/module.pmod:1.17
Rev: src/array.c:1.205
Rev: src/builtin_functions.c:1.659
Rev: src/gc.c:1.305
Rev: src/gc.h:1.131
Rev: src/mapping.c:1.199
Rev: src/modules/Gmp/acconfig.h:1.8
Rev: src/modules/Gmp/configure.in:1.48
Rev: src/modules/Gmp/mpf.cmod:1.35
Rev: src/modules/Gmp/mpq.cmod:1.27
Rev: src/modules/Gmp/mpz_glue.c:1.178
Rev: src/multiset.c:1.107
Rev: src/object.c:1.288
Rev: src/pike_types.c:1.323
Rev: src/program.c:1.681
Rev: src/stralloc.c:1.216
Rev: src/stralloc.h:1.102
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: stralloc.c,v 1.215 2008/05/02 00:40:21 mast Exp $
+ || $Id: stralloc.c,v 1.216 2008/05/02 04:15:16 mast Exp $
*/
#include "global.h"
2122:
size[0]=size_;
}
+ void gc_mark_string_as_referenced (struct pike_string *s)
+ {
+ if (gc_mark (s))
+ if (Pike_in_gc == GC_PASS_COUNT_MEMORY)
+ gc_counted_bytes += memory_in_string (s);
+ }
+
#ifdef PIKE_DEBUG
unsigned gc_touch_all_strings(void)
{
2143: Inside #if defined(PIKE_DEBUG)
for(e=0;e<htable_size;e++)
{
struct pike_string *p;
- for(p=base_table[e];p;p=p->next) gc_is_referenced(p);
+ for(p=base_table[e];p;p=p->next)
+ gc_mark_string_as_referenced(p);
}
}
#endif