]> granicus.if.org Git - gc/commitdiff
Rename ATOMIC_UNCOLLECTABLE to GC_ATOMIC_UNCOLLECTABLE
authorIvan Maidanski <ivmai@mail.ru>
Sat, 11 Apr 2015 07:25:45 +0000 (10:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 11 May 2015 15:56:42 +0000 (18:56 +0300)
(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).

Makefile.direct
SMakefile.amiga
configure.ac
dbg_mlc.c
doc/README.Mac
doc/README.macros
extra/AmigaOS.c
include/new_gc_alloc.h
include/private/gc_priv.h
mallocx.c
mark.c

index 8ab80e8b56517d03f80f07364323142467a40890..12b0d2e993162b0ceb6374bcd5354c708e2ab359 100644 (file)
@@ -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:
index 229f184f729fe8e72ffe7b1e2ea31d4167066ff2..57b87e91df6b92c41fe67d40ff8c5056f0e04164 100644 (file)
@@ -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 \
index 45ab69329e4d15b92ae6aa9e0c022d279526e045..fc6792395ca400d28d3e537a8f33d9b4c905c19f 100644 (file)
@@ -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
 
index fef1a251de93dc06eb9164ac1df5fda20ed19483..97b5636ea67d1bd2d321d770289f06c09d37bd97 100644 (file)
--- 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
index 55906697d20e190bdb74084013fd056099acbf16..f8acdf6656559b44e099f91be6a19e2297c02c6a 100644 (file)
@@ -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
index 3cc302e7bf637ee71d2da2256196fa2e6a769590..feb419dca2fadcd9188f977ec7fdb3f01498faeb 100644 (file)
@@ -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.
 
index 366ef94ec61833ffc79bb08b4cd54d4540c60760..2ec113379680e788bba90a074ebe38603214a129 100644 (file)
@@ -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
                         ){
index 94020cdd62b8449321d754971c624cad735e7414..8255b11b9ce93e2900c3fa6879fb45c54e9c5c31 100644 (file)
@@ -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.
 //
index ffbcc5ba7e3a5b8643c7bb89ba29299aa1afcbb5..8757647da364de3ecf9373a6ad9e518e84280880 100644 (file)
@@ -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)
index c8895a1f2bdc2dad3eb752b0ffd96718136292df..c851fcb9eb8ae16cd7bcaeb25db8f79766c31541 100644 (file)
--- 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 6e594804513ddcb147ad3c04f7c6b1a28c25158c..80d09cf51a9ee5cb28f030d8094a36da3cf34c28 100644 (file)
--- 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;