From 906149d548d967da1b9bc3e0ce0099f3287918ca Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Mon, 23 Jun 2008 18:41:03 +0200 Subject: [PATCH] mc_count_bytes fix. Rev: src/modules/Gmp/mpf.cmod:1.38 Rev: src/modules/Gmp/mpq.cmod:1.30 Rev: src/program.c:1.720 --- src/modules/Gmp/mpf.cmod | 4 ++-- src/modules/Gmp/mpq.cmod | 4 ++-- src/program.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/Gmp/mpf.cmod b/src/modules/Gmp/mpf.cmod index 130ebd5c1e..2210258df6 100644 --- a/src/modules/Gmp/mpf.cmod +++ b/src/modules/Gmp/mpf.cmod @@ -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: mpf.cmod,v 1.37 2008/05/29 21:58:44 mast Exp $ +|| $Id: mpf.cmod,v 1.38 2008/06/23 16:41:03 mast Exp $ */ #include "global.h" @@ -903,7 +903,7 @@ PIKECLASS mpf GC_RECURSE { - if (mc_count_bytes (THIS)) + if (mc_count_bytes (Pike_fp->current_object)) /* FIXME: Should count the allocated size. */ mc_counted_bytes += (mpf_get_prec (THISMPF) + 7) / 8 + sizeof (mpf_t); } diff --git a/src/modules/Gmp/mpq.cmod b/src/modules/Gmp/mpq.cmod index a4db13e00f..ed58b4bb89 100644 --- a/src/modules/Gmp/mpq.cmod +++ b/src/modules/Gmp/mpq.cmod @@ -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: mpq.cmod,v 1.29 2008/05/29 21:58:44 mast Exp $ +|| $Id: mpq.cmod,v 1.30 2008/06/23 16:41:03 mast Exp $ */ #include "global.h" @@ -941,7 +941,7 @@ PIKECLASS mpq GC_RECURSE { - if (mc_count_bytes (THIS)) + if (mc_count_bytes (Pike_fp->current_object)) mc_counted_bytes += #ifdef MPZ_T_HAS__MP_ALLOC mpq_numref (THISMPQ)[0]._mp_alloc * sizeof (mp_limb_t) + diff --git a/src/program.c b/src/program.c index 7946924bfa..61bbf3ded0 100644 --- a/src/program.c +++ b/src/program.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: program.c,v 1.719 2008/06/10 13:56:51 grubba Exp $ +|| $Id: program.c,v 1.720 2008/06/23 16:41:02 mast Exp $ */ #include "global.h" @@ -3770,7 +3770,7 @@ PMOD_EXPORT void set_exit_callback(void (*exit)(struct object *)) * the C level then you should add something like this to the recurse * callback so that Pike.count_memory remains accurate: * - * if (mc_count_bytes (Pike_fp->current_storage)) + * if (mc_count_bytes (Pike_fp->current_object)) * mc_counted_bytes += <size of the allocated memory block(s)> * * If the allocated memory is shared between objects then it gets more -- GitLab