Commit e40217a7 by Tom Tromey Committed by Tom Tromey

boehm.cc (_Jv_InitGC): Set GC_java_finalization.

	* boehm.cc (_Jv_InitGC): Set GC_java_finalization.
	(sum_blocks): Removed.
	(_Jv_GCFreeMemory): Use GC_get_free_bytes.

From-SVN: r30335
parent 3d43c074
1999-11-01 Tom Tromey <tromey@cygnus.com>
* boehm.cc (_Jv_InitGC): Set GC_java_finalization.
(sum_blocks): Removed.
(_Jv_GCFreeMemory): Use GC_get_free_bytes.
1999-11-01 Bryce McKinlay <bryce@albatross.co.nz> 1999-11-01 Bryce McKinlay <bryce@albatross.co.nz>
* java/io/PrintStream (PrintStream): Fix illegal usage of "this" * java/io/PrintStream (PrintStream): Fix illegal usage of "this"
......
...@@ -368,28 +368,10 @@ _Jv_GCTotalMemory (void) ...@@ -368,28 +368,10 @@ _Jv_GCTotalMemory (void)
return GC_get_heap_size (); return GC_get_heap_size ();
} }
/* Sum size of each hblk. */
static void
sum_blocks (struct hblk *h, word arg)
{
long *sump = (long *) arg;
/* This evil computation is from boehm-gc/checksums.c. */
hdr *hhdr = HDR (h);
int bytes = WORDS_TO_BYTES (hhdr->hb_sz);
bytes += HDR_BYTES + HBLKSIZE - 1;
bytes &= ~ (HBLKSIZE - 1);
*sump += bytes;
}
/* This turns out to be expensive to implement. For now, we don't
care. We could make it less expensive, perhaps, but that would
require some changes to the collector. */
long long
_Jv_GCFreeMemory (void) _Jv_GCFreeMemory (void)
{ {
long sum = 0; return GC_get_free_bytes ();
GC_apply_to_all_blocks (sum_blocks, &sum);
return sum;
} }
void void
...@@ -423,6 +405,8 @@ _Jv_InitGC (void) ...@@ -423,6 +405,8 @@ _Jv_InitGC (void)
} }
initialized = 1; initialized = 1;
GC_java_finalization = 1;
// Set up state for marking and allocation of Java objects. // Set up state for marking and allocation of Java objects.
obj_free_list = (ptr_t *) GC_generic_malloc_inner ((MAXOBJSZ + 1) obj_free_list = (ptr_t *) GC_generic_malloc_inner ((MAXOBJSZ + 1)
* sizeof (ptr_t), * sizeof (ptr_t),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment