diff options
-rw-r--r-- | Makefile.direct | 3 | ||||
-rw-r--r-- | Makefile.dj | 2 | ||||
-rw-r--r-- | SMakefile.amiga | 2 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | dbg_mlc.c | 10 | ||||
-rw-r--r-- | doc/README.Mac | 2 | ||||
-rw-r--r-- | doc/README.macros | 2 | ||||
-rw-r--r-- | extra/AmigaOS.c | 2 | ||||
-rw-r--r-- | gc_cpp.cc | 5 | ||||
-rw-r--r-- | include/gc.h | 2 | ||||
-rw-r--r-- | include/new_gc_alloc.h | 2 | ||||
-rw-r--r-- | include/private/config.h.in | 2 | ||||
-rw-r--r-- | include/private/gc_priv.h | 9 | ||||
-rw-r--r-- | mallocx.c | 10 | ||||
-rw-r--r-- | mark.c | 6 |
16 files changed, 37 insertions, 26 deletions
diff --git a/Makefile.direct b/Makefile.direct index 707a94e2..4bd588ee 100644 --- a/Makefile.direct +++ b/Makefile.direct @@ -35,7 +35,8 @@ VPATH= $(srcdir) AO_SRC_DIR=$(srcdir)/libatomic_ops AO_INSTALL_DIR=$(srcdir)/libatomic_ops-install -CFLAGS= -O -I$(srcdir)/include -I$(AO_INSTALL_DIR)/include -DATOMIC_UNCOLLECTABLE -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS +CFLAGS= -O -I$(srcdir)/include -I$(AO_INSTALL_DIR)/include \ + -DGC_ATOMIC_UNCOLLECTABLE -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS # To build the parallel collector on Linux, add to the above: # -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC diff --git a/Makefile.dj b/Makefile.dj index aa10badd..6b2c164a 100644 --- a/Makefile.dj +++ b/Makefile.dj @@ -27,7 +27,7 @@ EXE_SUFFIX=.exe srcdir= . VPATH= $(srcdir) -CFLAGS= -gstabs+ -O2 -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION +CFLAGS= -gstabs+ -O2 -I$(srcdir)/include -DGC_ATOMIC_UNCOLLECTABLE -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION # Look into doc/README.macros for the description of the "define arguments" # influencing the collector configuration. diff --git a/SMakefile.amiga b/SMakefile.amiga index acdca66a..ddf1ce43 100644 --- a/SMakefile.amiga +++ b/SMakefile.amiga @@ -32,7 +32,7 @@ DEFINE __USE_SYSBASE SOPT= $(OPT) $(IGNORE) \ DEFINE AMIGA_SKIP_SEG \ -DEFINE ATOMIC_UNCOLLECTABLE \ +DEFINE GC_ATOMIC_UNCOLLECTABLE \ DEFINE GC_AMIGA_FASTALLOC \ DEFINE GC_AMIGA_RETRY \ DEFINE GC_AMIGA_PRINTSTATS \ @@ -16467,7 +16467,7 @@ fi if test x"$enable_atomic_uncollectible" != x"no"; then -$as_echo "#define ATOMIC_UNCOLLECTABLE 1" >>confdefs.h +$as_echo "#define GC_ATOMIC_UNCOLLECTABLE 1" >>confdefs.h fi diff --git a/configure.ac b/configure.ac index f25d0216..00dd3797 100644 --- a/configure.ac +++ b/configure.ac @@ -602,7 +602,7 @@ AC_ARG_ENABLE(atomic-uncollectable, [AC_HELP_STRING([--disable-atomic-uncollectible], [Disable support for atomic uncollectible allocation.])]) if test x"$enable_atomic_uncollectible" != x"no"; then - AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1, + AC_DEFINE([GC_ATOMIC_UNCOLLECTABLE], 1, [Define to enable atomic uncollectible allocation.]) fi @@ -345,7 +345,7 @@ STATIC void GC_print_type(ptr_t p) case UNCOLLECTABLE: GC_err_puts("UNCOLLECTABLE"); break; -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE case AUNCOLLECTABLE: GC_err_puts("ATOMIC UNCOLLECTABLE"); break; @@ -718,7 +718,7 @@ GC_API void * GC_CALL GC_debug_malloc_uncollectable(size_t lb, return (GC_store_debug_info(result, (word)lb, s, i)); } -#ifdef ATOMIC_UNCOLLECTABLE +#ifdef GC_ATOMIC_UNCOLLECTABLE GC_API void * GC_CALL GC_debug_malloc_atomic_uncollectable(size_t lb, GC_EXTRA_PARAMS) { @@ -739,7 +739,7 @@ GC_API void * GC_CALL GC_debug_malloc_uncollectable(size_t lb, ADD_CALL_CHAIN(result, ra); return (GC_store_debug_info(result, (word)lb, s, i)); } -#endif /* ATOMIC_UNCOLLECTABLE */ +#endif /* GC_ATOMIC_UNCOLLECTABLE */ #ifndef GC_FREED_MEM_MARKER # if CPP_WORDSZ == 32 @@ -791,7 +791,7 @@ GC_API void GC_CALL GC_debug_free(void * p) } else { hdr * hhdr = HDR(p); if (hhdr -> hb_obj_kind == UNCOLLECTABLE -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE || hhdr -> hb_obj_kind == AUNCOLLECTABLE # endif ) { @@ -858,7 +858,7 @@ GC_API void * GC_CALL GC_debug_realloc(void * p, size_t lb, GC_EXTRA_PARAMS) case UNCOLLECTABLE: result = GC_debug_malloc_uncollectable(lb, OPT_RA s, i); break; -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE case AUNCOLLECTABLE: result = GC_debug_malloc_atomic_uncollectable(lb, OPT_RA s, i); break; diff --git a/doc/README.Mac b/doc/README.Mac index ae9c1d5e..b47d0f96 100644 --- a/doc/README.Mac +++ b/doc/README.Mac @@ -175,7 +175,7 @@ of every source file. I used these: //#define DONT_ADD_BYTE_AT_END // disables the padding if defined. //#define SMALL_CONFIG // whether to use a smaller heap. #define NO_SIGNALS // signals aren't real on the Macintosh. - #define ATOMIC_UNCOLLECTABLE // GC_malloc_atomic_uncollectable() + #define GC_ATOMIC_UNCOLLECTABLE // GC_malloc_atomic_uncollectable() // define either or none as per personal preference // used in malloc.c diff --git a/doc/README.macros b/doc/README.macros index a6291baf..58ed868a 100644 --- a/doc/README.macros +++ b/doc/README.macros @@ -248,7 +248,7 @@ FINALIZE_ON_DEMAND Causes finalizers to be run only in response In 5.0 this became runtime adjustable, and this only determines the initial value of GC_finalize_on_demand. -ATOMIC_UNCOLLECTABLE Includes code for GC_malloc_atomic_uncollectable. +GC_ATOMIC_UNCOLLECTABLE Includes code for GC_malloc_atomic_uncollectable. This is useful if either the vendor malloc implementation is poor, or if REDIRECT_MALLOC is used. diff --git a/extra/AmigaOS.c b/extra/AmigaOS.c index d1715039..2cf098de 100644 --- a/extra/AmigaOS.c +++ b/extra/AmigaOS.c @@ -476,7 +476,7 @@ void *GC_amiga_allocwrapper_any(size_t size,void *(*AllocFunction)(size_t size2) // printf("trying to force... %d bytes... ",size); if( AllocFunction!=GC_malloc_uncollectable -#ifdef ATOMIC_UNCOLLECTABLE +#ifdef GC_ATOMIC_UNCOLLECTABLE && AllocFunction!=GC_malloc_atomic_uncollectable #endif ){ @@ -32,4 +32,9 @@ Authors: John R. Ellis and Jesse Hull # define GC_BUILD # endif +#if !defined(GC_ATOMIC_UNCOLLECTABLE) && defined(ATOMIC_UNCOLLECTABLE) + /* For compatibility with old-style naming. */ +# define GC_ATOMIC_UNCOLLECTABLE +#endif + #include "gc_cpp.h" diff --git a/include/gc.h b/include/gc.h index a846f186..8b88bc9a 100644 --- a/include/gc.h +++ b/include/gc.h @@ -36,7 +36,7 @@ // lets provide the equivalent of system's malloc() // this is useful if we force-include the gc but hack other libs // to be a bit more gc-aware -#define ATOMIC_UNCOLLECTABLE +#define GC_ATOMIC_UNCOLLECTABLE #ifndef GC_H #define GC_H diff --git a/include/new_gc_alloc.h b/include/new_gc_alloc.h index 4612aeb6..7c2479c1 100644 --- a/include/new_gc_alloc.h +++ b/include/new_gc_alloc.h @@ -20,7 +20,7 @@ // It also doesn't yet understand the new header file names or // namespaces. // -// This assumes the collector has been compiled with -DATOMIC_UNCOLLECTABLE. +// This assumes the collector has been compiled with -DGC_ATOMIC_UNCOLLECTABLE. // The user should also consider -DREDIRECT_MALLOC=GC_uncollectable_malloc, // to ensure that object allocated through malloc are traced. // diff --git a/include/private/config.h.in b/include/private/config.h.in index a14c0f34..7785e39a 100644 --- a/include/private/config.h.in +++ b/include/private/config.h.in @@ -4,7 +4,7 @@ #undef ALL_INTERIOR_POINTERS /* Define to enable atomic uncollectible allocation. */ -#undef ATOMIC_UNCOLLECTABLE +#undef GC_ATOMIC_UNCOLLECTABLE /* See doc/README.macros. */ #undef DARWIN_DONT_PARSE_STACK diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index d3d14ca3..822bb6be 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -94,6 +94,11 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # include "gcconfig.h" #endif +#if !defined(GC_ATOMIC_UNCOLLECTABLE) && defined(ATOMIC_UNCOLLECTABLE) + /* For compatibility with old-style naming. */ +# define GC_ATOMIC_UNCOLLECTABLE +#endif + #ifndef GC_INNER /* This tagging macro must be used at the start of every variable */ /* definition which is declared with GC_EXTERN. Should be also used */ @@ -1046,7 +1051,7 @@ struct _GC_arrays { /* objects on this and auobjfreelist */ /* are always marked, except during */ /* garbage collections. */ -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE # define GC_auobjfreelist GC_arrays._auobjfreelist void *_auobjfreelist[MAXOBJGRANULES+1]; /* Atomic uncollectable but traced objs */ @@ -1243,7 +1248,7 @@ GC_EXTERN struct obj_kind { #define PTRFREE 0 #define NORMAL 1 #define UNCOLLECTABLE 2 -#ifdef ATOMIC_UNCOLLECTABLE +#ifdef GC_ATOMIC_UNCOLLECTABLE # define AUNCOLLECTABLE 3 # define STUBBORN 4 # define IS_UNCOLLECTABLE(k) (((k) & ~1) == UNCOLLECTABLE) @@ -42,7 +42,7 @@ void ** const GC_objfreelist_ptr = GC_objfreelist; void ** const GC_aobjfreelist_ptr = GC_aobjfreelist; void ** const GC_uobjfreelist_ptr = GC_uobjfreelist; -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE void ** const GC_auobjfreelist_ptr = GC_auobjfreelist; # endif @@ -60,10 +60,10 @@ STATIC void * GC_generic_or_special_malloc(size_t lb, int knd) return(GC_malloc((size_t)lb)); case UNCOLLECTABLE: return(GC_malloc_uncollectable((size_t)lb)); -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE case AUNCOLLECTABLE: return(GC_malloc_atomic_uncollectable((size_t)lb)); -# endif /* ATOMIC_UNCOLLECTABLE */ +# endif default: return(GC_generic_malloc(lb,knd)); } @@ -497,7 +497,7 @@ GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb) return 0; } -#ifdef ATOMIC_UNCOLLECTABLE +#ifdef GC_ATOMIC_UNCOLLECTABLE /* Allocate lb bytes of pointerfree, untraced, uncollectable data */ /* This is normally roughly equivalent to the system malloc. */ /* But it may be useful if malloc is redefined. */ @@ -545,7 +545,7 @@ GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb) return((void *) op); } } -#endif /* ATOMIC_UNCOLLECTABLE */ +#endif /* GC_ATOMIC_UNCOLLECTABLE */ /* provide a version of strdup() that uses the collector to allocate the copy of the string */ @@ -59,7 +59,7 @@ GC_INNER struct obj_kind GC_obj_kinds[MAXOBJKINDS] = { /* UNCOLLECTABLE */ { &GC_uobjfreelist[0], 0, 0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE }, -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE /* AUNCOLLECTABLE */ { &GC_auobjfreelist[0], 0, 0 | GC_DS_LENGTH, FALSE /* add length to descr */, FALSE }, @@ -70,7 +70,7 @@ GC_INNER struct obj_kind GC_obj_kinds[MAXOBJKINDS] = { # endif }; -# ifdef ATOMIC_UNCOLLECTABLE +# ifdef GC_ATOMIC_UNCOLLECTABLE # ifdef STUBBORN_ALLOC # define GC_N_KINDS_INITIAL_VALUE 5 # else @@ -82,7 +82,7 @@ GC_INNER struct obj_kind GC_obj_kinds[MAXOBJKINDS] = { # else # define GC_N_KINDS_INITIAL_VALUE 3 # endif -# endif +# endif /* !GC_ATOMIC_UNCOLLECTABLE */ GC_INNER unsigned GC_n_kinds = GC_N_KINDS_INITIAL_VALUE; |