summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2015-04-11 10:25:45 +0300
committerIvan Maidanski <ivmai@mail.ru>2015-05-11 18:56:42 +0300
commit54dbd6bfb4bb6336b447fbe6351a8457f52c8b16 (patch)
treee8fe08eeb86440caea215f6bb09c44dfd92057c5
parente05caf837e4dfa97ac84349e23e271bd1aa3ee7c (diff)
downloadbdwgc-54dbd6bfb4bb6336b447fbe6351a8457f52c8b16.tar.gz
Rename ATOMIC_UNCOLLECTABLE to GC_ATOMIC_UNCOLLECTABLE
(code refactoring) * Makefile.direct (CFLAGS): Add GC_ prefix to ATOMIC_UNCOLLECTABLE. * 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. * doc/README.macros (ATOMIC_UNCOLLECTABLE): 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).
-rw-r--r--Makefile.direct2
-rw-r--r--SMakefile.amiga2
-rw-r--r--configure.ac2
-rw-r--r--dbg_mlc.c12
-rw-r--r--doc/README.Mac2
-rw-r--r--doc/README.macros2
-rw-r--r--extra/AmigaOS.c2
-rw-r--r--include/new_gc_alloc.h2
-rw-r--r--include/private/gc_priv.h9
-rw-r--r--mallocx.c10
-rw-r--r--mark.c6
11 files changed, 28 insertions, 23 deletions
diff --git a/Makefile.direct b/Makefile.direct
index 8ab80e8b..12b0d2e9 100644
--- a/Makefile.direct
+++ b/Makefile.direct
@@ -36,7 +36,7 @@ AO_SRC_DIR=$(srcdir)/libatomic_ops
CFLAGS_EXTRA=
CFLAGS= -O -I$(srcdir)/include -I$(AO_SRC_DIR)/src \
- -DATOMIC_UNCOLLECTABLE -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS \
+ -DGC_ATOMIC_UNCOLLECTABLE -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS \
$(CFLAGS_EXTRA)
# To build the parallel collector on Linux, add to the above:
diff --git a/SMakefile.amiga b/SMakefile.amiga
index 229f184f..57b87e91 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.ac b/configure.ac
index 45ab6932..fc679239 100644
--- a/configure.ac
+++ b/configure.ac
@@ -780,7 +780,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 fef1a251..97b5636e 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -370,7 +370,7 @@ STATIC void GC_print_obj(ptr_t p)
case UNCOLLECTABLE:
kind_str = "UNCOLLECTABLE";
break;
-# ifdef ATOMIC_UNCOLLECTABLE
+# ifdef GC_ATOMIC_UNCOLLECTABLE
case AUNCOLLECTABLE:
kind_str = "ATOMIC_UNCOLLECTABLE";
break;
@@ -783,7 +783,7 @@ GC_API GC_ATTR_MALLOC 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 GC_ATTR_MALLOC void * GC_CALL
GC_debug_malloc_atomic_uncollectable(size_t lb, GC_EXTRA_PARAMS)
{
@@ -801,7 +801,7 @@ GC_API GC_ATTR_MALLOC 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
@@ -852,7 +852,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
) {
@@ -924,7 +924,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;
@@ -961,7 +961,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL
return GC_debug_malloc(lb, OPT_RA s, i);
case UNCOLLECTABLE:
return GC_debug_malloc_uncollectable(lb, OPT_RA s, i);
-# ifdef ATOMIC_UNCOLLECTABLE
+# ifdef GC_ATOMIC_UNCOLLECTABLE
case AUNCOLLECTABLE:
return GC_debug_malloc_atomic_uncollectable(lb, OPT_RA s, i);
# endif
diff --git a/doc/README.Mac b/doc/README.Mac
index 55906697..f8acdf66 100644
--- a/doc/README.Mac
+++ b/doc/README.Mac
@@ -161,7 +161,7 @@ of every source file. I used these:
#define ALL_INTERIOR_POINTERS // follows interior pointers.
//#define DONT_ADD_BYTE_AT_END // disables the padding if defined.
//#define SMALL_CONFIG // whether to use a smaller heap.
- #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 3cc302e7..feb419dc 100644
--- a/doc/README.macros
+++ b/doc/README.macros
@@ -259,7 +259,7 @@ FINALIZE_ON_DEMAND Causes finalizers to be run only in response
GC_NO_FINALIZATION Exclude finalization support (for smaller code size)
-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 366ef94e..2ec11337 100644
--- a/extra/AmigaOS.c
+++ b/extra/AmigaOS.c
@@ -403,7 +403,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/include/new_gc_alloc.h b/include/new_gc_alloc.h
index 94020cdd..8255b11b 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/gc_priv.h b/include/private/gc_priv.h
index ffbcc5ba..8757647d 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 */
@@ -1213,7 +1218,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 uncollectible but traced objs */
@@ -1394,7 +1399,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 c8895a1f..c851fcb9 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
@@ -70,10 +70,10 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_or_special_malloc(size_t lb,
return GC_malloc(lb);
case UNCOLLECTABLE:
return GC_malloc_uncollectable(lb);
-# ifdef ATOMIC_UNCOLLECTABLE
+# ifdef GC_ATOMIC_UNCOLLECTABLE
case AUNCOLLECTABLE:
return GC_malloc_atomic_uncollectable(lb);
-# endif /* ATOMIC_UNCOLLECTABLE */
+# endif
default:
return GC_generic_malloc(lb, knd);
}
@@ -513,7 +513,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 pointer-free, untraced, uncollectible data */
/* This is normally roughly equivalent to the system malloc. */
/* But it may be useful if malloc is redefined. */
@@ -564,7 +564,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 6e594804..80d09cf5 100644
--- a/mark.c
+++ b/mark.c
@@ -58,7 +58,7 @@ GC_INNER struct obj_kind GC_obj_kinds[MAXOBJKINDS] = {
{ &GC_uobjfreelist[0], 0,
0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE
/*, */ OK_DISCLAIM_INITZ },
-# ifdef ATOMIC_UNCOLLECTABLE
+# ifdef GC_ATOMIC_UNCOLLECTABLE
/* AUNCOLLECTABLE */
{ &GC_auobjfreelist[0], 0,
0 | GC_DS_LENGTH, FALSE /* add length to descr */, FALSE
@@ -71,7 +71,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
@@ -83,7 +83,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;