From 21593b0324ba38cb6e1fcc4002c6d3fcc35f1b4e Mon Sep 17 00:00:00 2001 From: hboehm Date: Sun, 19 Mar 2006 06:22:21 +0000 Subject: [PATCH] 2006-03-18 Hans Boehm * configure.ac: Reenable gcj support. * configure: Regenerate. * thread_local_alloc.c(GC_gcj_malloc): fix. * gcj_mlc.c: (GC_gcj_malloc): fix printfs, delete dead lw assignment. * include/gc_gcj.h, tests/test.c: Remove gcj_fast_malloc references. --- configure | 5 ++--- configure.ac | 8 ++++---- gcj_mlc.c | 8 +++----- include/gc_gcj.h | 2 -- tests/test.c | 14 +++----------- thread_local_alloc.c | 12 +++++++----- 6 files changed, 19 insertions(+), 30 deletions(-) diff --git a/configure b/configure index 5750c4b..737c9e9 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.4 . +# From configure.ac Revision: 1.5 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for gc 7.0alpha6. # @@ -1042,7 +1042,7 @@ Optional Features: --enable-static=PKGS build static libraries default=yes --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) - --enable-gcj-support Enable support for gcj. + --disable-gcj-support Disable support for gcj. --disable-java-finalization Disable support for java finalization. --disable-atomic-uncollectible @@ -9779,7 +9779,6 @@ _ACEOF -enable_gcj_support=no # Check whether --enable-gcj-support or --disable-gcj-support was given. if test "${enable_gcj_support+set}" = set; then enableval="$enable_gcj_support" diff --git a/configure.ac b/configure.ac index 40d1381..a990f48 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_INIT(gc,7.0alpha6,Hans.Boehm@hp.com) AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1.5 $) +AC_REVISION($Revision: 1.6 $) GC_SET_VERSION AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc]) AM_MAINTAINER_MODE @@ -413,10 +413,10 @@ dnl dnl By default, make the library as general as possible. dnl :FIXME: gcj does not work as of gc-7.0_alpha2, so default set to no. -enable_gcj_support=no +dnl enable_gcj_support=no AC_ARG_ENABLE(gcj-support, - [AC_HELP_STRING([--enable-gcj-support], - [Enable support for gcj.])]) + [AC_HELP_STRING([--disable-gcj-support], + [Disable support for gcj.])]) AM_CONDITIONAL(ENABLE_GCJ_SUPPORT, [test x"$enable_gcj_support" != xno]) if test x"$enable_gcj_support" != xno; then diff --git a/gcj_mlc.c b/gcj_mlc.c index 9aecca3..7e5beb1 100644 --- a/gcj_mlc.c +++ b/gcj_mlc.c @@ -154,7 +154,6 @@ static void maybe_finalize() UNLOCK(); return(GC_oom_fn(lb)); } - lw = GC_size_map[lb]; /* May have been uninitialized. */ } else { *opp = obj_link(op); GC_bytes_allocd += GRANULES_TO_BYTES(lg); @@ -190,11 +189,10 @@ void * GC_debug_gcj_malloc(size_t lb, void * ptr_to_struct_containing_descr, result = GC_generic_malloc_inner(lb + DEBUG_BYTES, GC_gcj_debug_kind); if (result == 0) { UNLOCK(); - GC_err_printf2("GC_debug_gcj_malloc(%ld, 0x%lx) returning NIL (", - (unsigned long) lb, - (unsigned long) ptr_to_struct_containing_descr); + GC_err_printf("GC_debug_gcj_malloc(%ld, %p) returning NIL (", + (unsigned long)lb, ptr_to_struct_containing_descr); GC_err_puts(s); - GC_err_printf1(":%ld)\n", (unsigned long)i); + GC_err_printf(":%d)\n", i); return(GC_oom_fn(lb)); } *((void **)((ptr_t)result + sizeof(oh))) = ptr_to_struct_containing_descr; diff --git a/include/gc_gcj.h b/include/gc_gcj.h index a4ed4e4..699ddf5 100644 --- a/include/gc_gcj.h +++ b/include/gc_gcj.h @@ -84,11 +84,9 @@ extern int GC_gcj_debug_kind; # ifdef GC_DEBUG # define GC_GCJ_MALLOC(s,d) GC_debug_gcj_malloc(s,d,GC_EXTRAS) -# define GC_GCJ_FAST_MALLOC(s,d) GC_debug_gcj_fast_malloc(s,d,GC_EXTRAS) # define GC_GCJ_MALLOC_IGNORE_OFF_PAGE(s,d) GC_debug_gcj_malloc(s,d,GC_EXTRAS) # else # define GC_GCJ_MALLOC(s,d) GC_gcj_malloc(s,d) -# define GC_GCJ_FAST_MALLOC(s,d) GC_gcj_fast_malloc(s,d) # define GC_GCJ_MALLOC_IGNORE_OFF_PAGE(s,d) \ GC_gcj_malloc_ignore_off_page(s,d) # endif diff --git a/tests/test.c b/tests/test.c index afe62f2..6c48e29 100644 --- a/tests/test.c +++ b/tests/test.c @@ -278,17 +278,9 @@ sexpr y; sexpr result; static int count = 0; - if (++count & 1) { -# ifdef USE_MARK_BYTES - r = (GC_word *) GC_GCJ_FAST_MALLOC(4, &gcj_class_struct1); -# else - r = (GC_word *) GC_GCJ_FAST_MALLOC(3, &gcj_class_struct1); -# endif - } else { - r = (GC_word *) GC_GCJ_MALLOC(sizeof(struct SEXPR) - + sizeof(struct fake_vtable*), - &gcj_class_struct2); - } + r = (GC_word *) GC_GCJ_MALLOC(sizeof(struct SEXPR) + + sizeof(struct fake_vtable*), + &gcj_class_struct2); if (r == 0) { (void)GC_printf("Out of memory\n"); exit(1); diff --git a/thread_local_alloc.c b/thread_local_alloc.c index 34d2409..8cb105f 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -191,13 +191,15 @@ void * GC_gcj_malloc(size_t bytes, { size_t granules = ROUNDED_UP_GRANULES(bytes); void *result; - void **tiny_fl = (GC_tlfs)GC_getspecific(GC_thread_key) - -> ptrfree_freelists; + void **tiny_fl = ((GC_tlfs)GC_getspecific(GC_thread_key)) + -> gcj_freelists; GC_ASSERT(GC_gcj_malloc_initialized); GC_FAST_MALLOC_GRANS(result, bytes, tiny_fl, DIRECT_GRANULES, - PTRFREE, GC_core_gcj_malloc(bytes), - (AO_compiler_barrier(), - *(void **)result = ptr_to_struct_containing_descr)); + GC_gcj_kind, + GC_core_gcj_malloc(bytes, + ptr_to_struct_containing_descr), + {AO_compiler_barrier(); + *(void **)result = ptr_to_struct_containing_descr;}); /* This forces the initialization of the "method ptr". */ /* This is necessary to ensure some very subtle properties */ /* required if a GC is run in the middle of such an allocation. */ -- 2.7.4