summaryrefslogtreecommitdiff
path: root/libguile/gc.c
diff options
context:
space:
mode:
authorLudovic Courtes <ludovic.courtes@laas.fr>2006-04-02 21:05:04 +0000
committerLudovic Courtès <ludo@gnu.org>2008-09-05 00:46:14 +0200
commitfca4388748645f817e69505cb2c2c7733debb99b (patch)
tree109d3297fb1525f7c6a6288f509f57c8ee9fa5b5 /libguile/gc.c
parentc812243ba15a9d13bb6f1876892e7a1efea9bf4e (diff)
downloadguile-fca4388748645f817e69505cb2c2c7733debb99b.tar.gz
First ``working'' Guile! Crashes in `flush-all-ports' (relates to SCM_I_PORT_TABLE).
* libguile/gc.c (scm_gc_stats): Fixed so that it returns a relevant result instead of just `SCM_EOL'. * libguile/ports.c: Include `assert.h'. Don't include `malloc.h'. (scm_make_port_type): Use `scm_gc_realloc ()' instead of `realloc ()'. (scm_new_port_table_entry): Likewise. (scm_flush): Added an assertion on the port number. (scm_ports_prehistory): Use `scm_gc_malloc ()' instead of `scm_malloc ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-3
Diffstat (limited to 'libguile/gc.c')
-rw-r--r--libguile/gc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libguile/gc.c b/libguile/gc.c
index 5f237b810..eb2e15c3c 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -332,17 +332,15 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0,
abort();
#endif
- return SCM_EOL; /* FIXME */
-#if 0
/* Below, we cons to produce the resulting list. We want a snapshot of
* the heap situation before consing.
*/
local_scm_mtrigger = scm_mtrigger;
local_scm_mallocated = scm_mallocated;
- local_scm_heap_size = 0; /* SCM_HEAP_SIZE; */ /* FIXME */
+ local_scm_heap_size = GC_get_heap_size ();
local_scm_cells_allocated = scm_cells_allocated;
-
+
local_scm_gc_time_taken = scm_gc_time_taken;
local_scm_gc_mark_time_taken = scm_gc_mark_time_taken;
local_scm_gc_times = scm_gc_times;
@@ -356,12 +354,17 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0,
+(double) scm_gc_cells_swept
-(double) scm_gc_cells_collected;
+#if 0
for (i = table_size; i--;)
{
heap_segs = scm_cons (scm_cons (scm_from_ulong (bounds[2*i]),
scm_from_ulong (bounds[2*i+1])),
heap_segs);
}
+#else
+ heap_segs = scm_list (SCM_INUM0); /* FIXME */
+#endif
+
/* njrev: can any of these scm_cons's or scm_list_n signal a memory
error? If so we need a frame here. */
answer =
@@ -392,10 +395,9 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0,
scm_cons (sym_heap_segments, heap_segs),
SCM_UNDEFINED);
SCM_CRITICAL_SECTION_END;
-
- free (bounds);
+
+/* free (bounds); */
return answer;
-#endif
}
#undef FUNC_NAME