summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2015-04-11 10:25:45 +0300
committerIvan Maidanski <ivmai@mail.ru>2015-04-30 21:29:45 +0300
commitd17b7881f61846745cef1ff644146546bf2c4426 (patch)
tree96e08cbc6ff44349a02538b8eeab6d0461bd28f7
parentde31c2b70a2d6728be7015b4cb45ed51347f161a (diff)
downloadbdwgc-d17b7881f61846745cef1ff644146546bf2c4426.tar.gz
Rename ATOMIC_UNCOLLECTABLE to GC_ATOMIC_UNCOLLECTABLE
(code refactoring) * Makefile.direct (CFLAGS): Add GC_ prefix to ATOMIC_UNCOLLECTABLE. * Makefile.dj (CFLAGS): Likewise. * SMakefile.amiga: Likewise. * configure.ac (enable_atomic_uncollectible): Likewise. * dbg_mlc.c (GC_print_obj, GC_debug_malloc_atomic_uncollectable, GC_debug_free, GC_debug_realloc): Likewise. * doc/README.Mac: Likewise. * extra/AmigaOS.c (GC_amiga_allocwrapper_any): Likewise. * include/new_gc_alloc.h: Likewise. * include/private/gc_priv.h (struct _GC_arrays, AUNCOLLECTABLE): Likewise. * mallocx.c (GC_auobjfreelist_ptr, GC_generic_or_special_malloc, GC_malloc_atomic_uncollectable): Likewise. * mark.c (GC_obj_kinds, GC_N_KINDS_INITIAL_VALUE): Likewise. * include/private/gc_priv.h (GC_ATOMIC_UNCOLLECTABLE): Define if ATOMIC_UNCOLLECTABLE defined (for compatibility with the clients that do not use GC makefiles). * gc_cpp.cc (GC_ATOMIC_UNCOLLECTABLE): Likewise. * configure: Regenerate. * include/private/config.h.in: Likewise.
-rw-r--r--Makefile.direct3
-rw-r--r--Makefile.dj2
-rw-r--r--SMakefile.amiga2
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--dbg_mlc.c10
-rw-r--r--doc/README.Mac2
-rw-r--r--doc/README.macros2
-rw-r--r--extra/AmigaOS.c2
-rw-r--r--gc_cpp.cc5
-rw-r--r--include/gc.h2
-rw-r--r--include/new_gc_alloc.h2
-rw-r--r--include/private/config.h.in2
-rw-r--r--include/private/gc_priv.h9
-rw-r--r--mallocx.c10
-rw-r--r--mark.c6
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 \
diff --git a/configure b/configure
index 7f975b40..2d7f469b 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/dbg_mlc.c b/dbg_mlc.c
index 6f51c030..f154099b 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -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
){
diff --git a/gc_cpp.cc b/gc_cpp.cc
index 3a01a631..826c9ba4 100644
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -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)
diff --git a/mallocx.c b/mallocx.c
index d38e308c..484549f1 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -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 */
diff --git a/mark.c b/mark.c
index 9a34082d..7802fc86 100644
--- a/mark.c
+++ b/mark.c
@@ -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;