diff options
author | Bryce McKinlay <bryce@waitaki.otago.ac.nz> | 2001-05-21 08:35:14 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2001-05-21 09:35:14 +0100 |
commit | 9110a741e35c54e46c00662ddc420575376c5947 (patch) | |
tree | 67e9db3b367c46dfbcccda8278d06da72494187d /boehm-gc/gcj_mlc.c | |
parent | a6951ca5dee8ed05749cdc697767910aebaedcc0 (diff) | |
download | gcc-9110a741e35c54e46c00662ddc420575376c5947.zip gcc-9110a741e35c54e46c00662ddc420575376c5947.tar.gz gcc-9110a741e35c54e46c00662ddc420575376c5947.tar.bz2 |
Imported version version 6.0alpha7.
* README, README.Mac, README.OS2, README.QUICK, README.alpha,
README.amiga, README.debugging, README.dj, README.hp, README.linux,
README.rs6000, README.sgi, README.solaris2, README.uts,
README.win32, SCoptions.amiga, backptr.h, barrett_diagram,
dbg_mlc.h, gc.h, gc.man, gc_alloc.h, gc_cpp.h, gc_hdrs.h, gc_mark.h,
gc_priv.h, gc_private.h, gc_typed.h, gcconfig.h,
hpux_irix_threads.c, makefile.depend, nursery.c,
solaris_threads.h, test.c, test_cpp.cc, weakpointer.h, cord/README,
cord/SCOPTIONS.amiga, cord/SMakefile.amiga, cord/cord.h,
cord/ec.h, cord/gc.h, cord/private/cord_pos.h, include/backptr.h,
include/gc_copy_descr.h, include/gc_nursery.h: Remove obsolete/moved
files.
From-SVN: r42379
Diffstat (limited to 'boehm-gc/gcj_mlc.c')
-rw-r--r-- | boehm-gc/gcj_mlc.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/boehm-gc/gcj_mlc.c b/boehm-gc/gcj_mlc.c index 519c5cb..5f5636d 100644 --- a/boehm-gc/gcj_mlc.c +++ b/boehm-gc/gcj_mlc.c @@ -17,13 +17,13 @@ #ifdef GC_GCJ_SUPPORT /* - * This is an allocator interface tuned for gcj (the GNU/Cygnus static + * This is an allocator interface tuned for gcj (the GNU static * java compiler). * * Each allocated object has a pointer in its first word to a vtable, * which for our purposes is simply a structure describing the type of * the object. - * This descriptor structur contains a GC marking descriptor at offset + * This descriptor structure contains a GC marking descriptor at offset * MARK_DESCR_OFFSET. * * It is hoped that this interface may also be useful for other systems, @@ -36,10 +36,10 @@ * 3) FASTLOCK is not a significant win. */ -#include "gc_priv.h" -#include "gc_mark.h" -#include "include/gc_gcj.h" -#include "dbg_mlc.h" +#include "private/gc_priv.h" +#include "private/gc_pmark.h" +#include "gc_gcj.h" +#include "private/dbg_mlc.h" GC_bool GC_gcj_malloc_initialized = FALSE; @@ -51,12 +51,8 @@ int GC_gcj_debug_kind; /* The kind of objects that is always marked */ ptr_t * GC_gcjobjfreelist; ptr_t * GC_gcjdebugobjfreelist; -void * GC_default_oom_action(void) { return 0; } - -void * (*GC_oom_action)(void) = GC_default_oom_action; - /* Caller does not hold allocation lock. */ -void GC_init_gcj_malloc(int mp_index, void * /* really mark_proc */mp) +void GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) { register int i; DCL_LOCK_STATE; @@ -70,23 +66,23 @@ void GC_init_gcj_malloc(int mp_index, void * /* really mark_proc */mp) return; } GC_gcj_malloc_initialized = TRUE; - GC_mark_procs[mp_index] = (mark_proc)mp; + GC_mark_procs[mp_index] = (GC_mark_proc)mp; if (mp_index >= GC_n_mark_procs) ABORT("GC_init_gcj_malloc: bad index"); /* Set up object kind gcj-style indirect descriptor. */ GC_gcjobjfreelist = (ptr_t *) - GC_generic_malloc_inner((MAXOBJSZ+1)*sizeof(ptr_t), PTRFREE); + GC_INTERNAL_MALLOC((MAXOBJSZ+1)*sizeof(ptr_t), PTRFREE); if (GC_gcjobjfreelist == 0) ABORT("Couldn't allocate GC_gcjobjfreelist"); BZERO(GC_gcjobjfreelist, (MAXOBJSZ+1)*sizeof(ptr_t)); GC_gcj_kind = GC_n_kinds++; GC_obj_kinds[GC_gcj_kind].ok_freelist = GC_gcjobjfreelist; GC_obj_kinds[GC_gcj_kind].ok_reclaim_list = 0; GC_obj_kinds[GC_gcj_kind].ok_descriptor = - (((word)(-MARK_DESCR_OFFSET - INDIR_PER_OBJ_BIAS)) | DS_PER_OBJECT); + (((word)(-MARK_DESCR_OFFSET - GC_INDIR_PER_OBJ_BIAS)) | GC_DS_PER_OBJECT); GC_obj_kinds[GC_gcj_kind].ok_relocate_descr = FALSE; GC_obj_kinds[GC_gcj_kind].ok_init = TRUE; /* Set up object kind for objects that require mark proc call. */ GC_gcjdebugobjfreelist = (ptr_t *) - GC_generic_malloc_inner((MAXOBJSZ+1)*sizeof(ptr_t), PTRFREE); + GC_INTERNAL_MALLOC((MAXOBJSZ+1)*sizeof(ptr_t), PTRFREE); if (GC_gcjdebugobjfreelist == 0) ABORT("Couldn't allocate GC_gcjdebugobjfreelist"); BZERO(GC_gcjdebugobjfreelist, (MAXOBJSZ+1)*sizeof(ptr_t)); @@ -94,7 +90,7 @@ void GC_init_gcj_malloc(int mp_index, void * /* really mark_proc */mp) GC_obj_kinds[GC_gcj_debug_kind].ok_freelist = GC_gcjdebugobjfreelist; GC_obj_kinds[GC_gcj_debug_kind].ok_reclaim_list = 0; GC_obj_kinds[GC_gcj_debug_kind].ok_descriptor = - MAKE_PROC(mp_index, 1 /* allocated with debug info */); + GC_MAKE_PROC(mp_index, 1 /* allocated with debug info */); GC_obj_kinds[GC_gcj_debug_kind].ok_relocate_descr = FALSE; GC_obj_kinds[GC_gcj_debug_kind].ok_init = TRUE; UNLOCK(); @@ -119,7 +115,7 @@ register ptr_t * opp; register word lw; DCL_LOCK_STATE; - if( SMALL_OBJ(lb) ) { + if( EXPECT(SMALL_OBJ(lb), 1) ) { # ifdef MERGE_SIZES lw = GC_size_map[lb]; # else @@ -127,11 +123,12 @@ DCL_LOCK_STATE; # endif opp = &(GC_gcjobjfreelist[lw]); LOCK(); - if( (op = *opp) == 0 ) { + op = *opp; + if( EXPECT(op == 0, 0)) { op = (ptr_t)GENERAL_MALLOC((word)lb, GC_gcj_kind); if (0 == op) { UNLOCK(); - return(GC_oom_action()); + return(GC_oom_fn(lb)); } # ifdef MERGE_SIZES lw = GC_size_map[lb]; /* May have been uninitialized. */ @@ -147,7 +144,7 @@ DCL_LOCK_STATE; op = (ptr_t)GENERAL_MALLOC((word)lb, GC_gcj_kind); if (0 == op) { UNLOCK(); - return(GC_oom_action()); + return(GC_oom_fn(lb)); } *(void **)op = ptr_to_struct_containing_descr; UNLOCK(); @@ -174,7 +171,7 @@ GC_PTR GC_debug_gcj_malloc(size_t lb, void * ptr_to_struct_containing_descr, (unsigned long) ptr_to_struct_containing_descr); GC_err_puts(s); GC_err_printf1(":%ld)\n", (unsigned long)i); - return(GC_oom_action()); + return(GC_oom_fn(lb)); } *((void **)((ptr_t)result + sizeof(oh))) = ptr_to_struct_containing_descr; UNLOCK(); @@ -196,12 +193,13 @@ DCL_LOCK_STATE; opp = &(GC_gcjobjfreelist[lw]); LOCK(); - if( (op = *opp) == 0 ) { + op = *opp; + if( EXPECT(op == 0, 0) ) { op = (ptr_t)GC_clear_stack( GC_generic_malloc_words_small_inner(lw, GC_gcj_kind)); if (0 == op) { UNLOCK(); - return(GC_oom_action()); + return GC_oom_fn(WORDS_TO_BYTES(lw)); } } else { *opp = obj_link(op); @@ -232,7 +230,7 @@ void * GC_debug_gcj_fast_malloc(size_t lw, (unsigned long) ptr_to_struct_containing_descr); GC_err_puts(s); GC_err_printf1(":%ld)\n", (unsigned long)i); - return(GC_oom_action()); + return GC_oom_fn(WORDS_TO_BYTES(lw)); } *((void **)((ptr_t)result + sizeof(oh))) = ptr_to_struct_containing_descr; UNLOCK(); |