From 6fe8d9f16793264f1c3c5e510e7c98204e6cf113 Mon Sep 17 00:00:00 2001 From: ivmai Date: Wed, 1 Jun 2011 12:34:42 +0000 Subject: [PATCH] 2011-06-01 Ivan Maidanski * src/atomic_ops_malloc.c (AO_malloc_enable_mmap): Workaround for Sun C compiler (call "release" variant of AO_store). --- ChangeLog | 5 +++++ src/atomic_ops_malloc.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 027c09e..e241328 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-06-01 Ivan Maidanski + * src/atomic_ops_malloc.c (AO_malloc_enable_mmap): Workaround for + Sun C compiler (call "release" variant of AO_store). + +2011-06-01 Ivan Maidanski + * configure.ac (_PTHREADS): New template (used for NetBSD). * configure.ac (THREADDLLIBS): New macro. * tests/Makefile.am (test_atomic_LDADD, test_stack_LDADD, diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index 3af585e..c2401f3 100644 --- a/src/atomic_ops_malloc.c +++ b/src/atomic_ops_malloc.c @@ -94,7 +94,12 @@ static volatile AO_t mmap_enabled = 0; void AO_malloc_enable_mmap(void) { - AO_store(&mmap_enabled, 1); +# if defined(__sun) + AO_store_release(&mmap_enabled, 1); + /* Workaround for Sun CC */ +# else + AO_store(&mmap_enabled, 1); +# endif } static char *get_mmaped(size_t sz) -- 2.7.4