[kaffe] CVS kaffe (dalibor): Made gc_heap_base and gc_heap_range static

Kaffe CVS cvs-commits at kaffe.org
Fri Sep 3 12:12:26 PDT 2004


PatchSet 5141 
Date: 2004/09/03 19:08:16
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Made gc_heap_base and gc_heap_range static

2004-09-03  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffevm/kaffe-gc/gc-incremental.c
        Use gc_get_heap_base und gc_get_heap_range.

        * kaffe/kaffevm/kaffe-gc/gc-incremental.h:
        (gc_heap_base, gc_heap_range) Removed prototypes.

        * kaffe/kaffevm/kaffe-gc/gc-mem.c:
        (gc_heap_base, gc_heap_range) Made static.
        (gc_get_heap_base, gc_get_heap_range) New functions.

        * kaffe/kaffevm/kaffe-gc/gc-mem.h:
        (gc_get_heap_base, gc_get_heap_range) Added prototypes.

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

Members: 
	ChangeLog:1.2697->1.2698 
	kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.8->1.9 
	kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.3->1.4 
	kaffe/kaffevm/kaffe-gc/gc-mem.c:1.13->1.14 
	kaffe/kaffevm/kaffe-gc/gc-mem.h:1.11->1.12 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2697 kaffe/ChangeLog:1.2698
--- kaffe/ChangeLog:1.2697	Fri Sep  3 17:10:53 2004
+++ kaffe/ChangeLog	Fri Sep  3 19:08:16 2004
@@ -1,4 +1,21 @@
-2004-09-03  Dalibor Topic  <topic at mpiat2313>
+2004-09-03  Dalibor Topic  <robilad at kaffe.org>
+
+	* kaffe/kaffevm/kaffe-gc/gc-incremental.c
+	Use gc_get_heap_base und gc_get_heap_range.
+
+	* kaffe/kaffevm/kaffe-gc/gc-incremental.h:
+	(gc_heap_base, gc_heap_range) Removed prototypes.
+
+	* kaffe/kaffevm/kaffe-gc/gc-mem.c:
+	(gc_heap_base, gc_heap_range) Made static.
+	(gc_get_heap_base, gc_get_heap_range) New functions.
+
+	* kaffe/kaffevm/kaffe-gc/gc-mem.h:
+	(gc_get_heap_base, gc_get_heap_range) Added prototypes.
+
+	Reported by: Michael Franz <developer.franz at verizon.net>
+	
+2004-09-03  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/kaffe-gc/gc-mem.h: (gc_heap_limit) Removed.
 	(gc_get_heap_limit) Added prototype.
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.8 kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.9
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.8	Fri Sep  3 17:10:55 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c	Fri Sep  3 19:08:20 2004
@@ -82,8 +82,8 @@
 
 /* Is this pointer within our managed heap? */
 #define IS_A_HEAP_POINTER(from) \
-        ((uintp) (from) >= gc_heap_base && \
-	 (uintp) (from) < gc_heap_base + gc_heap_range)
+        ((uintp) (from) >= gc_get_heap_base() && \
+	 (uintp) (from) < gc_get_heap_base() + gc_get_heap_range())
 
 static void *reserve;
 static void *outOfMem;
@@ -232,9 +232,9 @@
 static inline int
 gc_heap_isobject(gc_block *info, gc_unit *unit)
 {
-	uintp p = (uintp) UTOMEM(unit) - gc_heap_base;
+	uintp p = (uintp) UTOMEM(unit) - gc_get_heap_base();
 
-	if (!(p & (MEMALIGN - 1)) && p < gc_heap_range && GCBLOCKINUSE(info)) {
+	if (!(p & (MEMALIGN - 1)) && p < gc_get_heap_range() && GCBLOCKINUSE(info)) {
 		/* Make sure 'unit' refers to the beginning of an
 		 * object.  We do this by making sure it is correctly
 		 * aligned within the block.
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.3 kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.4
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.3	Tue Aug 31 10:38:15 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h	Fri Sep  3 19:08:20 2004
@@ -20,9 +20,7 @@
 #define	MAX_HEAPSIZE	(64*1024*1024)
 #define	ALLOC_HEAPSIZE	(1024*1024)
 
-extern uintp gc_heap_base;
 extern uintp gc_block_base;
-extern uintp gc_heap_range;	/* last gc-able address - gc_heap_base */
 
 /* ------------------------------------------------------------------------ */
 
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.13 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.14
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.13	Fri Sep  3 17:10:55 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c	Fri Sep  3 19:08:20 2004
@@ -107,9 +107,8 @@
 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 */
-
-uintp gc_heap_base;
-uintp gc_heap_range;
+static uintp gc_heap_base;              /* start of the heap */
+static uintp gc_heap_range;             /* last gc-able address - gc_heap_base */
 
 #ifndef gc_pgsize
 static size_t gc_pgsize;
@@ -1259,4 +1258,22 @@
 gc_get_heap_limit(void)
 {
   return gc_heap_limit;
+}
+
+/**
+ * Gets start of the heap.
+ */
+uintp
+gc_get_heap_base(void)
+{
+  return gc_heap_base;
+}
+
+/**
+ * Gets last gc-able address - start of the heap.
+ */
+uintp
+gc_get_heap_range(void)
+{
+  return gc_heap_range;
 }
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.11 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.12
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h:1.11	Fri Sep  3 17:10:55 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.h	Fri Sep  3 19:08:21 2004
@@ -64,6 +64,8 @@
 extern void*	gc_heap_grow(size_t);
 extern size_t   gc_get_heap_total(void);
 extern size_t   gc_get_heap_limit(void);
+extern uintp    gc_get_heap_base(void);
+extern uintp    gc_get_heap_range(void);
 
 /**
  * One block of the heap managed by kaffe's gc.




More information about the kaffe mailing list