]> granicus.if.org Git - libatomic_ops/commitdiff
2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
authorhboehm <hboehm>
Sat, 26 Jul 2008 00:51:35 +0000 (00:51 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jul 2011 12:03:24 +0000 (16:03 +0400)
Ivan's description of the patch follows. Note that a few pieces like
the GC_malloc(0) patch, were not applied since an alternate had been
previously applied.  A few differed stylistically from the rest of
the code (mostly casts to void * instead of target type),
or were classified as too minor to bother.  Note that
all of Ivan's static declarations which did not correct outright
naming bugs (as a few did), where replaced by STATIC, which is
ignored by default.

        - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
  GC_malloc(0));
        - addition of missing getter/setter functions for public variables
  (may be useful if compiled as Win32 DLL);
        - addition of missing GC_API for some exported functions;
        - addition of missing "static" declarator for internal functions
   and variables (where possible);
        - replacement of all remaining K&R-style definitions with ANSI
  C ones (__STDC__ macro is not used anymore);
        - addition of some Win32 macro definitions (that may be missing in
  the standard headers supplied with a compiler) for GWW_VDB mode;
        - elimination of most compiler warnings (except for
  "uninitialized data" warning);
        - several typos correction;
        - missing parenthesis addition in macros in some header files of
  "libatomic_ops" module.

My highlights based on reading the patch:

* allchblk.c: Remove GC_freehblk_ptr decl.
Make free_list_index_of() static.
* include/gc.h: Use __int64 on win64, define GC_oom_func,
GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
add getter and setters: GC_get_gc_no, GC_get_parallel,
GC_set_oom_fn, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_dont_expand,
GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
gc_config_macros.h: Define _REENTRANT after processing
GC_THREADS.
* include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
handling of operator new[] for old Windows compilers.
* include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
around arguments.
* dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
* mark.c (GC_mark_and_push_stack): Fix source argument for
blacklist printing.
* misc.c: Fix log file naming based on environment variable
for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
just return current value with 0 argument.  Add DONT_USER_USER32_DLL.
Add various getters and setters as in gc.h.
* os_dep.c: Remove no longer used GC_disable/enable_signals
implementations.  (GC_get_stack_base): Add pthread_attr_destroy
call.  No longer set GC_old_bus_handler in DARWIN workaround.
* pthread_support.c: GC_register_my_thread must also
call GC_init_thread_local.

ChangeLog
src/atomic_ops.h
src/atomic_ops/sysdeps/ao_t_is_int.h

index 77b1ca7b7e362a0b66710881bcadd87f7a69470b..98b47c3317fb9c6a968c8b8b1cf670de0081b350 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-07-24 Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
+       * src/atomic_ops/sysdeps/ao_t_is_int.h, src/atomic_ops.h:
+       Add parentheses around addr arg for various functions.
+
 2008-07-18 Hans Boehm <Hans.Boehm@hp.com>
        * src/atomic_ops/sysdeps/gcc/powerpc.h:
        Add const to first parameter of load calls (forgot one).
index a34ebc2887dafc28c9d5114f90dcbaaddd5a8d96..43986e90f9ffcad70e05da0d2540437a7fd4f460 100755 (executable)
 /* The most common way to clear a test-and-set location                */
 /* at the end of a critical section.                           */
 #if AO_AO_TS_T && !defined(AO_CLEAR)
-# define AO_CLEAR(addr) AO_store_release((AO_TS_t *)addr, AO_TS_CLEAR)
+# define AO_CLEAR(addr) AO_store_release((AO_TS_t *)(addr), AO_TS_CLEAR)
 #endif
 #if AO_CHAR_TS_T && !defined(AO_CLEAR)
-# define AO_CLEAR(addr) AO_char_store_release((AO_TS_t *)addr, AO_TS_CLEAR)
+# define AO_CLEAR(addr) AO_char_store_release((AO_TS_t *)(addr), AO_TS_CLEAR)
 #endif
 
 /*
index ab9b6622b3913212aa96a629696bb72cd91c96be..c7803c5b7c015efd439f35d24be909bcda7c0e19 100644 (file)
 #if defined(AO_HAVE_compare_and_swap_full) && \
     !defined(AO_HAVE_int_compare_and_swap_full)
 #  define AO_int_compare_and_swap_full(addr, old, new_val) \
-               AO_compare_and_swap_full((volatile AO_t *)addr, \
-                                        (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap_full((volatile AO_t *)(addr), \
+                                       (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap_full
 # endif
 
 #if defined(AO_HAVE_compare_and_swap_acquire) && \
     !defined(AO_HAVE_int_compare_and_swap_acquire)
 #  define AO_int_compare_and_swap_acquire(addr, old, new_val) \
-               AO_compare_and_swap_acquire((volatile AO_t *)addr, \
-                                           (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap_acquire((volatile AO_t *)(addr), \
+                                           (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap_acquire
 # endif
 
 #if defined(AO_HAVE_compare_and_swap_release) && \
     !defined(AO_HAVE_int_compare_and_swap_release)
 #  define AO_int_compare_and_swap_release(addr, old, new_val) \
-               AO_compare_and_swap_release((volatile AO_t *)addr, \
-                                        (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap_release((volatile AO_t *)(addr), \
+                                        (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap_release
 # endif
 
 #if defined(AO_HAVE_compare_and_swap_write) && \
     !defined(AO_HAVE_int_compare_and_swap_write)
 #  define AO_int_compare_and_swap_write(addr, old, new_val) \
-               AO_compare_and_swap_write((volatile AO_t *)addr, \
-                                         (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap_write((volatile AO_t *)(addr), \
+                                         (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap_write
 # endif
 
 #if defined(AO_HAVE_compare_and_swap_read) && \
     !defined(AO_HAVE_int_compare_and_swap_read)
 #  define AO_int_compare_and_swap_read(addr, old, new_val) \
-               AO_compare_and_swap_read((volatile AO_t *)addr, \
-                                        (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap_read((volatile AO_t *)(addr), \
+                                        (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap_read
 # endif
 
 #if defined(AO_HAVE_compare_and_swap) && \
     !defined(AO_HAVE_int_compare_and_swap)
 #  define AO_int_compare_and_swap(addr, old, new_val) \
-               AO_compare_and_swap((volatile AO_t *)addr, \
-                                   (AO_t) old, (AO_t)new_val)
+               AO_compare_and_swap((volatile AO_t *)(addr), \
+                                   (AO_t)(old), (AO_t)(new_val))
 #  define AO_HAVE_int_compare_and_swap
 # endif
 
 #if defined(AO_HAVE_load_acquire) && \
     !defined(AO_HAVE_int_load_acquire)
 #  define AO_int_load_acquire(addr) \
-       (int)AO_load_acquire((const volatile AO_t *)addr)
+       (int)AO_load_acquire((const volatile AO_t *)(addr))
 #  define AO_HAVE_int_load_acquire
 # endif
 
 #if defined(AO_HAVE_store_release) && \
     !defined(AO_HAVE_int_store_release)
 #  define AO_int_store_release(addr, val) \
-       AO_store_release((volatile AO_t *)addr, (AO_t)val)
+       AO_store_release((volatile AO_t *)(addr), (AO_t)(val))
 #  define AO_HAVE_int_store_release
 # endif
 
 #if defined(AO_HAVE_fetch_and_add_full) && \
     !defined(AO_HAVE_int_fetch_and_add_full)
 #  define AO_int_fetch_and_add_full(addr, incr) \
-       (int)AO_fetch_and_add_full((volatile AO_t *)addr, (AO_t)incr)
+       (int)AO_fetch_and_add_full((volatile AO_t *)(addr), (AO_t)(incr))
 #  define AO_HAVE_int_fetch_and_add_full
 # endif
 
 #if defined(AO_HAVE_fetch_and_add1_acquire) && \
     !defined(AO_HAVE_int_fetch_and_add1_acquire)
 #  define AO_int_fetch_and_add1_acquire(addr) \
-       (int)AO_fetch_and_add1_acquire((volatile AO_t *)addr)
+       (int)AO_fetch_and_add1_acquire((volatile AO_t *)(addr))
 #  define AO_HAVE_int_fetch_and_add1_acquire
 # endif
 
 #if defined(AO_HAVE_fetch_and_add1_release) && \
     !defined(AO_HAVE_int_fetch_and_add1_release)
 #  define AO_int_fetch_and_add1_release(addr) \
-       (int)AO_fetch_and_add1_release((volatile AO_t *)addr)
+       (int)AO_fetch_and_add1_release((volatile AO_t *)(addr))
 #  define AO_HAVE_int_fetch_and_add1_release
 # endif
 
 #if defined(AO_HAVE_fetch_and_sub1_acquire) && \
     !defined(AO_HAVE_int_fetch_and_sub1_acquire)
 #  define AO_int_fetch_and_sub1_acquire(addr) \
-       (int)AO_fetch_and_sub1_acquire((volatile AO_t *)addr)
+       (int)AO_fetch_and_sub1_acquire((volatile AO_t *)(addr))
 #  define AO_HAVE_int_fetch_and_sub1_acquire
 # endif
 
 #if defined(AO_HAVE_fetch_and_sub1_release) && \
     !defined(AO_HAVE_int_fetch_and_sub1_release)
 #  define AO_int_fetch_and_sub1_release(addr) \
-       (int)AO_fetch_and_sub1_release((volatile AO_t *)addr)
+       (int)AO_fetch_and_sub1_release((volatile AO_t *)(addr))
 #  define AO_HAVE_int_fetch_and_sub1_release
 # endif