diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-02 00:12:10 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-02 00:12:10 +0000 |
commit | 2fc453e651840c339b4f1d7386e84d91716f57f9 (patch) | |
tree | 5af320ca89be31cc40ce1c2bd128991ee310abce /libjava/boehm.cc | |
parent | dd013e58d5d4c2c8e93304f3d014f593691d6ad5 (diff) | |
download | gcc-2fc453e651840c339b4f1d7386e84d91716f57f9.tar.gz |
* boehm.cc (_Jv_InitGC): Set GC_java_finalization.
(sum_blocks): Removed.
(_Jv_GCFreeMemory): Use GC_get_free_bytes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30335 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/boehm.cc')
-rw-r--r-- | libjava/boehm.cc | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/libjava/boehm.cc b/libjava/boehm.cc index fb11a112873..39fc9af9b09 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -368,28 +368,10 @@ _Jv_GCTotalMemory (void) 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 _Jv_GCFreeMemory (void) { - long sum = 0; - GC_apply_to_all_blocks (sum_blocks, &sum); - return sum; + return GC_get_free_bytes (); } void @@ -423,6 +405,8 @@ _Jv_InitGC (void) } initialized = 1; + GC_java_finalization = 1; + // Set up state for marking and allocation of Java objects. obj_free_list = (ptr_t *) GC_generic_malloc_inner ((MAXOBJSZ + 1) * sizeof (ptr_t), |