[kaffe] CVS kaffe (guilhem): Kaffe-GC fix for heap growing.

Kaffe CVS cvs-commits at kaffe.org
Sun Jul 17 03:02:15 PDT 2005


PatchSet 6738 
Date: 2005/07/17 09:57:53
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Kaffe-GC fix for heap growing.

        * kaffe/kaffevm/kaffe-gc/gc-mem.c
        (gc_block_alloc): Relocate gc_last_block too.

Members: 
	ChangeLog:1.4262->1.4263 
	kaffe/kaffevm/kaffe-gc/gc-mem.c:1.30->1.31 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4262 kaffe/ChangeLog:1.4263
--- kaffe/ChangeLog:1.4262	Sun Jul 17 08:11:17 2005
+++ kaffe/ChangeLog	Sun Jul 17 09:57:53 2005
@@ -1,3 +1,8 @@
+2005-07-16  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* kaffe/kaffevm/kaffe-gc/gc-mem.c
+	(gc_block_alloc): Relocate gc_last_block too.
+
 2005-07-17  Kurt Miller <truk at optonline.net>
 
 	* kaffe/kaffeh/main.c
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.30 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.31
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.30	Wed Jul 13 13:31:15 2005
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c	Sun Jul 17 09:57:56 2005
@@ -363,8 +363,12 @@
 	gc_block** mptr;
 	gc_block* blk;
 	size_t nsz;
+#if defined(KAFFE_STATS)
+	static timespent heap_alloc_time;
+#endif
 
 	lockStaticMutex(&gc_heap_lock);
+	startTiming(&heap_alloc_time, "gc_heap_malloc");
 
 DBG(SLACKANAL,
 	if (KGC_SMALL_OBJECT(sz)) {
@@ -445,6 +449,7 @@
 	assert(KGC_OBJECT_SIZE(mem) >= sz);
 
 	out:
+	stopTiming(&heap_alloc_time);
 	unlockStaticMutex(&gc_heap_lock);
 
 	return (mem);
@@ -461,6 +466,9 @@
 	int lnr;
 	int msz;
 	int idx;
+#if defined(KAFFE_STATS)
+	static timespent heap_free_time;
+#endif
 
 	info = gc_mem2block(mem);
 	idx = GCMEM2IDX(info, mem);
@@ -476,6 +484,7 @@
 	dprintf("gc_heap_free: memory %p size %d\n", mem, info->size);	);
 
 	lockStaticMutex(&gc_heap_lock);
+	startTiming(&heap_free_time, "gc_heap_free");
 
 	if (KGC_SMALL_OBJECT(info->size)) {
 		lnr = sztable[info->size].list;
@@ -532,6 +541,7 @@
 		gc_primitive_free(info);
 	}
 
+	stopTiming(&heap_free_time);
 	unlockStaticMutex(&gc_heap_lock);
 
 DBG(GCDIAG,
@@ -1198,6 +1208,7 @@
 				R(gc_block, freelist[i].list);
 
 			R(gc_block, gc_reserve_pages);
+			R(gc_block, gc_last_block);
 #undef R
 		}
 		KTHREAD(spinoff)(NULL);




More information about the kaffe mailing list