summaryrefslogtreecommitdiff
path: root/libguile/gc-malloc.c
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@lilypond.org>2002-09-05 21:12:21 +0000
committerHan-Wen Nienhuys <hanwen@lilypond.org>2002-09-05 21:12:21 +0000
commitffd724008bab4ee230af0a9210b19166b2c04f71 (patch)
tree1c76aa2025f57bd02b222271f07dfc9f174470b3 /libguile/gc-malloc.c
parent5bd4a949e87dce0abf8d140e2d9f2ca4ce808727 (diff)
downloadguile-ffd724008bab4ee230af0a9210b19166b2c04f71.tar.gz
* struct.h: change scm_structs_to_free to scm_i_structs_to_free
* gc-malloc.c (scm_gc_register_collectable_memory): use floats; these won't ever wrap around with high memory usage. * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
Diffstat (limited to 'libguile/gc-malloc.c')
-rw-r--r--libguile/gc-malloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c
index 7bf366b0d..2f39db0da 100644
--- a/libguile/gc-malloc.c
+++ b/libguile/gc-malloc.c
@@ -200,13 +200,15 @@ scm_gc_register_collectable_memory (void *mem, size_t size, const char *what)
*/
if (scm_mallocated > scm_mtrigger)
{
- long prev_alloced = scm_mallocated;
+ unsigned long prev_alloced = scm_mallocated;
float yield;
scm_igc (what);
scm_i_sweep_all_segments("mtrigger");
- yield = (prev_alloced - scm_mallocated) / (float) prev_alloced;
+ yield = ((float)prev_alloced - (float) scm_mallocated)
+ / (float) prev_alloced;
+
scm_gc_malloc_yield_percentage = (int) (100 * yield);
#ifdef DEBUGINFO