diff options
Diffstat (limited to 'boehm-gc/include')
-rw-r--r-- | boehm-gc/include/gc_allocator.h | 17 | ||||
-rw-r--r-- | boehm-gc/include/gc_config_macros.h | 10 | ||||
-rw-r--r-- | boehm-gc/include/private/darwin_stop_world.h | 7 | ||||
-rw-r--r-- | boehm-gc/include/private/pthread_support.h | 5 |
4 files changed, 33 insertions, 6 deletions
diff --git a/boehm-gc/include/gc_allocator.h b/boehm-gc/include/gc_allocator.h index 87c85099381..200f181efa6 100644 --- a/boehm-gc/include/gc_allocator.h +++ b/boehm-gc/include/gc_allocator.h @@ -35,7 +35,17 @@ * library, which itself was derived from the SGI STL implementation. */ -#include "gc.h" // For size_t +#ifndef GC_ALLOCATOR_H + +#define GC_ALLOCATOR_H + +#include "gc.h" + +#if defined(__GNUC__) +# define GC_ATTR_UNUSED __attribute__((unused)) +#else +# define GC_ATTR_UNUSED +#endif /* First some helpers to allow us to dispatch on whether or not a type * is known to be pointerfree. @@ -118,7 +128,7 @@ public: } // __p is not permitted to be a null pointer. - void deallocate(pointer __p, size_type GC_n) + void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n) { GC_FREE(__p); } size_type max_size() const throw() @@ -194,7 +204,7 @@ public: } // __p is not permitted to be a null pointer. - void deallocate(pointer __p, size_type GC_n) + void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n) { GC_FREE(__p); } size_type max_size() const throw() @@ -230,3 +240,4 @@ inline bool operator!=(const traceable_allocator<GC_T1>&, const traceable_alloca return false; } +#endif /* GC_ALLOCATOR_H */ diff --git a/boehm-gc/include/gc_config_macros.h b/boehm-gc/include/gc_config_macros.h index 0c836d876c8..d8d31141262 100644 --- a/boehm-gc/include/gc_config_macros.h +++ b/boehm-gc/include/gc_config_macros.h @@ -97,7 +97,10 @@ # endif #endif /* GC_THREADS */ -#if defined(GC_THREADS) && !defined(GC_PTHREADS) && defined(MSWIN32) +#if defined(GC_THREADS) && !defined(GC_PTHREADS) && \ + (defined(_WIN32) || defined(_MSC_VER) || defined(__CYGWIN__) \ + || defined(__MINGW32__) || defined(__BORLANDC__) \ + || defined(_WIN32_WCE)) # define GC_WIN32_THREADS #endif @@ -106,8 +109,9 @@ #endif # define __GC -# include <stddef.h> -# ifdef _WIN32_WCE +# ifndef _WIN32_WCE +# include <stddef.h> +# else /* ! _WIN32_WCE */ /* Yet more kluges for WinCE */ # include <stdlib.h> /* size_t is defined here */ typedef long ptrdiff_t; /* ptrdiff_t is not defined */ diff --git a/boehm-gc/include/private/darwin_stop_world.h b/boehm-gc/include/private/darwin_stop_world.h index 9924297ec77..f6f5314ee31 100644 --- a/boehm-gc/include/private/darwin_stop_world.h +++ b/boehm-gc/include/private/darwin_stop_world.h @@ -12,4 +12,11 @@ struct thread_stop_info { mach_port_t mach_thread; }; +struct GC_mach_thread { + thread_act_t thread; + int already_suspended; +}; + +void GC_darwin_register_mach_handler_thread(mach_port_t thread); + #endif diff --git a/boehm-gc/include/private/pthread_support.h b/boehm-gc/include/private/pthread_support.h index 0ef917e7ef0..d52e4da90aa 100644 --- a/boehm-gc/include/private/pthread_support.h +++ b/boehm-gc/include/private/pthread_support.h @@ -93,5 +93,10 @@ GC_thread GC_lookup_thread(pthread_t id); void GC_stop_init(); +extern GC_bool GC_in_thread_creation; + /* We may currently be in thread creation or destruction. */ + /* Only set to TRUE while allocation lock is held. */ + /* When set, it is OK to run GC from unknown thread. */ + #endif /* GC_PTHREADS && !GC_SOLARIS_THREADS.... etc */ #endif /* GC_PTHREAD_SUPPORT_H */ |