[kaffe] CVS kaffe (dalibor): Made gc_heap_limit static

Kaffe CVS cvs-commits at kaffe.org
Fri Sep 3 10:14:50 PDT 2004


PatchSet 5140 
Date: 2004/09/03 17:10:53
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Made gc_heap_limit static

2004-09-03  Dalibor Topic  <topic at mpiat2313>

        * kaffe/kaffevm/kaffe-gc/gc-mem.h: (gc_heap_limit) Removed.
        (gc_get_heap_limit) Added prototype.

        * kaffe/kaffevm/kaffe-gc/gc-mem.c (gc_get_heap_limit): New function.
        (gc_heap_limit) Made static.

        * kaffe/kaffevm/kaffe-gc/gc-incremental.c (gcGetHeapLimit,gcMan):
        Use gc_get_heap_limit().

        Reported by: Michael Franz <developer.franz at verizon.net>

Members: 
	ChangeLog:1.2696->1.2697 
	kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.7->1.8 
	kaffe/kaffevm/kaffe-gc/gc-mem.c:1.12->1.13 
	kaffe/kaffevm/kaffe-gc/gc-mem.h:1.10->1.11 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2696 kaffe/ChangeLog:1.2697
--- kaffe/ChangeLog:1.2696	Fri Sep  3 11:12:36 2004
+++ kaffe/ChangeLog	Fri Sep  3 17:10:53 2004
@@ -1,3 +1,16 @@
+2004-09-03  Dalibor Topic  <topic at mpiat2313>
+
+	* kaffe/kaffevm/kaffe-gc/gc-mem.h: (gc_heap_limit) Removed.
+	(gc_get_heap_limit) Added prototype.
+
+	* kaffe/kaffevm/kaffe-gc/gc-mem.c (gc_get_heap_limit): New function.
+	(gc_heap_limit) Made static.
+
+	* kaffe/kaffevm/kaffe-gc/gc-incremental.c (gcGetHeapLimit,gcMan): 
+	Use gc_get_heap_limit().
+
+	Reported by: Michael Franz <developer.franz at verizon.net>
+	
 2004-09-03  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/kaffe-gc/gc-incremental.c: Use gc_get_heap_total.
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.7 kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.8
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.7	Fri Sep  3 11:12:37 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c	Fri Sep  3 17:10:55 2004
@@ -561,8 +561,9 @@
 		 *
 		 * XXX: make this a run-time configurable parameter.
 		 */
-		if (gcRunning == 1 && gc_get_heap_total() < gc_heap_limit && 
-		    gcStats.allocmem * 4 < gcStats.totalmem * 1) {
+		if (gcRunning == 1 
+		    && gc_get_heap_total() < gc_get_heap_limit() 
+		    && gcStats.allocmem * 4 < gcStats.totalmem * 1) {
 DBG(GCSTAT,
 			dprintf("skipping collection since alloc/total "
 				"%dK/%dK = %.2f < 1/3\n",
@@ -1420,7 +1421,7 @@
 static uintp
 gcGetHeapLimit(Collector *gcif UNUSED)
 {
-  return gc_heap_limit;
+  return gc_get_heap_limit();
 }
 
 static uintp
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.12 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.13
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.12	Fri Sep  3 11:12:37 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c	Fri Sep  3 17:10:55 2004
@@ -106,8 +106,8 @@
 static size_t gc_heap_allocation_size;	/* amount of memory by which to grow heap */
 static size_t gc_heap_initial_size;	/* amount of memory to initially allocate */
 static size_t gc_heap_total;		/* current size of the heap */
+static size_t gc_heap_limit;		/* maximum size to which heap should grow */
 
-size_t gc_heap_limit;		/* maximum size to which heap should grow */
 uintp gc_heap_base;
 uintp gc_heap_range;
 
@@ -1250,4 +1250,13 @@
 gc_get_heap_total(void)
 {
   return gc_heap_total;
+}
+
+/**
+ * Gets maximum size to which heap should grow.
+ */
+size_t
+gc_get_heap_limit(void)
+{
+  return gc_heap_limit;
 }
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.10 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.11
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.10	Fri Sep  3 11:12:37 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h	Fri Sep  3 17:10:55 2004
@@ -20,8 +20,6 @@
 #define ALIGNMENT_OF_SIZE(S)	(S)
 #endif
 
-extern size_t gc_heap_limit;
-
 #ifdef KAFFE_VMDEBUG
 extern int gc_system_alloc_cnt;
 #endif
@@ -65,6 +63,7 @@
 
 extern void*	gc_heap_grow(size_t);
 extern size_t   gc_get_heap_total(void);
+extern size_t   gc_get_heap_limit(void);
 
 /**
  * One block of the heap managed by kaffe's gc.




More information about the kaffe mailing list