/* only if AO_REQUIRE_CAS is defined (or if the corresponding */
/* AO_HAVE_x macro is defined). x86/x64 targets have AO_nop_full, */
/* AO_load_acquire, AO_store_release, at least. */
+# if !defined(AO_HAVE_load) || !defined(AO_HAVE_store)
+# error AO_load or AO_store is missing; probably old version of atomic_ops
+# endif
+
#endif /* !GC_BUILTIN_ATOMIC */
#endif /* GC_ATOMIC_OPS_H */
*/
# ifdef THREADS
-# if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
- && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2)
-# include "gc_atomic_ops.h"
-# endif
-
# ifdef PCR
# include <base/PCR_Base.h>
# include <th/PCR_Th.h>
# define GC_API_PRIV GC_API
#endif
+#if defined(THREADS) && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2)
+# include "gc_atomic_ops.h"
+#endif
+
#ifndef GC_LOCKS_H
# include "gc_locks.h"
#endif
# endif
#endif /* DARWIN */
-#ifdef PARALLEL_MARK
-# include "gc_atomic_ops.h"
-# define counter_t volatile AO_t
-#else
- typedef size_t counter_t;
-# if defined(THREADS) && (defined(MPROTECT_VDB) || defined(THREAD_SANITIZER) \
- || (defined(GC_ASSERTIONS) && defined(THREAD_LOCAL_ALLOC)))
-# include "gc_atomic_ops.h"
-# endif
-#endif /* !PARALLEL_MARK */
-
#include "../gc_tiny_fl.h"
#include <setjmp.h>
/* mod BYTES_TO_GRANULES(hb_sz), except */
/* for large blocks. See GC_obj_map. */
# endif
- counter_t hb_n_marks; /* Number of set mark bits, excluding */
+# ifdef PARALLEL_MARK
+ volatile AO_t hb_n_marks; /* Number of set mark bits, excluding */
/* the one always set at the end. */
/* Currently it is concurrently */
/* updated and hence only approximate. */
/* The count may also be too high if */
/* multiple mark threads mark the */
/* same object due to a race. */
- /* Without parallel marking, the count */
+# else
+ size_t hb_n_marks; /* Without parallel marking, the count */
/* is accurate. */
+# endif
# ifdef USE_MARK_BYTES
# define MARK_BITS_SZ (MARK_BITS_PER_HBLK + 1)
/* Unlike the other case, this is in units of bytes. */
#include <errno.h>
-#include "gc_atomic_ops.h"
-
/* Note: never put extern "C" around an #include. */
#ifdef __cplusplus
extern "C" {
word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED)
{
/* Avoid GC_noop6 calls to be optimized away. */
-# if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
- || defined(PARALLEL_MARK)
+# ifdef AO_CLEAR
AO_compiler_barrier(); /* to serve as a special side-effect */
# else
GC_noop1(0);
#include <time.h> /* for nanosleep() */
#include <unistd.h>
-#include "private/gc_atomic_ops.h"
-
#if (!defined(AO_HAVE_load_acquire) || !defined(AO_HAVE_store_release)) \
&& !defined(CPPCHECK)
# error AO_load_acquire and/or AO_store_release are missing;
exit(1); \
}
-#if defined(THREADS) && (defined(GC_BUILTIN_ATOMIC) \
- || defined(PARALLEL_MARK) \
- || !defined(GC_WIN32_THREADS))
-# include "private/gc_atomic_ops.h" /* for counters */
-#endif
-
/* Define AO primitives for a single-threaded mode. */
#ifndef AO_CLEAR
/* AO_t not defined. */
#include <stdio.h>
-#if defined(GC_BUILTIN_ATOMIC) || defined(PARALLEL_MARK) \
- || (defined(GC_THREADS) && !defined(_WIN32) && !defined(_MSC_VER) \
- && !defined(__CYGWIN__) && !defined(__MINGW32__))
+#if defined(GC_BUILTIN_ATOMIC) || defined(GC_THREADS)
# include <stdlib.h>
#ifdef GC_GCJ_SUPPORT
-# include "private/gc_atomic_ops.h" /* for AO_compiler_barrier() */
-
# include "include/gc_gcj.h"
/* Gcj-style allocation without locks is extremely tricky. The */
STATIC int GC_typed_mark_proc_index = 0; /* Indices of my mark */
STATIC int GC_array_mark_proc_index = 0; /* procedures. */
-#if defined(GC_FORCE_INCLUDE_ATOMIC_OPS) || defined(GC_BUILTIN_ATOMIC)
-# include "private/gc_atomic_ops.h"
-#endif
-
#ifdef AO_HAVE_load_acquire
STATIC volatile AO_t GC_explicit_typing_initialized = FALSE;
#else
#if (defined(GC_DLL) || defined(GC_INSIDE_DLL)) \
&& !defined(GC_NO_THREADS_DISCOVERY) && !defined(MSWINCE) \
&& !defined(THREAD_LOCAL_ALLOC) && !defined(GC_PTHREADS)
-# include "private/gc_atomic_ops.h"
/* This code operates in two distinct modes, depending on */
/* the setting of GC_win32_dll_threads. */