Merge branch 'upstream'

Former-commit-id: b8db1683801621c1fe992b0bc4a9d743100c7684
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:16:58 +00:00
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -42,11 +42,6 @@
# define GC_CONST
# endif
# ifdef __cplusplus
extern "C" {
# endif
/* Define word and signed_word to be unsigned and signed types of the */
/* size as char * or void *. There seems to be no way to do this */
/* even semi-portably. The following is probably no better/worse */
@@ -66,6 +61,10 @@
typedef __int64 GC_signed_word;
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Public read-only variables */
GC_API GC_word GC_gc_no;/* Counter incremented per collection. */
@@ -501,7 +500,17 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
#endif
#if defined(__linux__) || defined(__GLIBC__)
#ifdef __cplusplus
} // extern "C"
#endif
# include <features.h>
#ifdef __cplusplus
extern "C" {
#endif
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
&& !defined(__ia64__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
@@ -965,7 +974,17 @@ GC_API void (*GC_is_visible_print_proc)
#if !defined(GC_USE_LD_WRAP) && \
(defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) || defined(GC_DARWIN_THREADS) || defined(GC_MACOSX_THREADS))
#ifdef __cplusplus
} // extern "C"
#endif
# include "gc_pthread_redirects.h"
#ifdef __cplusplus
extern "C" {
#endif
#endif
# if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
@@ -985,8 +1004,17 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
#endif /* THREADS && !SRC_M3 */
#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
#ifdef __cplusplus
} // extern "C"
#endif
# include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef GC_INSIDE_DLL
BOOL WINAPI GC_DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved);
# endif
@@ -1081,6 +1109,10 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
GC_API void GC_win32_free_heap ();
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
/* Allocation really goes through GC_amiga_allocwrapper_do */
# include "gc_amiga_redirects.h"
@@ -1090,8 +1122,4 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
# include "gc_local_alloc.h"
#endif
#ifdef __cplusplus
} /* end of extern "C" */
#endif
#endif /* _GC_H */

View File

@@ -44,6 +44,10 @@
# include "gc.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* The following allocators signal an out of memory condition with */
/* return GC_oom_fn(bytes); */
@@ -110,4 +114,8 @@ extern int GC_gcj_debug_kind;
GC_gcj_malloc_ignore_off_page(s,d)
# endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* GC_GCJ_H */

View File

@@ -49,6 +49,10 @@
#ifndef GC_LOCAL_ALLOC_H
#define GC_LOCAL_ALLOC_H
#ifdef __cplusplus
extern "C" {
#endif
/* We assume ANSI C for this interface. */
GC_PTR GC_local_malloc(size_t bytes);
@@ -62,6 +66,10 @@ GC_PTR GC_local_malloc_atomic(size_t bytes);
void * ptr_to_struct_containing_descr);
#endif
#ifdef __cplusplus
} // extern "C"
#endif
# ifdef GC_DEBUG
/* We don't really use local allocation in this case. */
# define GC_LOCAL_MALLOC(s) GC_debug_malloc(s,GC_EXTRAS)

View File

@@ -15,6 +15,11 @@
/* facility in thr_keycreate. Alternatively, keep a redundant pointer */
/* to thread specific data on the thread stack. */
# include <thread.h>
#ifdef __cplusplus
extern "C" {
#endif
int GC_thr_create(void *stack_base, size_t stack_size,
void *(*start_routine)(void *), void *arg, long flags,
thread_t *new_thread);
@@ -26,11 +31,22 @@
# define thr_join GC_thr_join
# define thr_suspend GC_thr_suspend
# define thr_continue GC_thr_continue
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* GC_SOLARIS_THREADS */
#if defined(GC_SOLARIS_PTHREADS)
# include <pthread.h>
# include <signal.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
void * (*thread_execp)(void *), void *arg);
@@ -39,6 +55,11 @@
# define pthread_join GC_pthread_join
# define pthread_create GC_pthread_create
# define pthread_detach GC_pthread_detach
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#if defined(GC_SOLARIS_PTHREADS) || defined(GC_SOLARIS_THREADS)
@@ -51,6 +72,10 @@
# include <pthread.h>
# include <signal.h>
#ifdef __cplusplus
extern "C" {
#endif
int GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);
@@ -87,6 +112,10 @@
# define dlopen GC_dlopen
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* GC_xxxxx_THREADS */
#endif /* GC_PTHREAD_REDIRECTS_H */

View File

@@ -43,7 +43,17 @@
*
*/
# ifdef THREADS
#ifdef __cplusplus
extern "C" {
#endif
void GC_noop1 GC_PROTO((word));
#ifdef __cplusplus
} // extern "C"
#endif
# ifdef PCR_OBSOLETE /* Faster, but broken with multiple lwp's */
# include "th/PCR_Th.h"
# include "th/PCR_ThCrSec.h"

View File

@@ -366,6 +366,10 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
# define BZERO(x,n) bzero((char *)(x),(int)(n))
# endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(DARWIN)
# if defined(POWERPC)
# define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
@@ -413,7 +417,18 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
* Stop and restart mutator threads.
*/
# ifdef PCR
#ifdef __cplusplus
} // extern "C"
#endif
# include "th/PCR_ThCtl.h"
#ifdef __cplusplus
extern "C" {
#endif
# define STOP_WORLD() \
PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_stopNormal, \
PCR_allSigsBlocked, \
@@ -1315,7 +1330,7 @@ void GC_initiate_gc GC_PROTO((void));
/* If the mark state is invalid, this */
/* becomes full colleection. Otherwise */
/* it's partial. */
void GC_push_all GC_PROTO((ptr_t bottom, ptr_t top));
void GC_push_all (void* bottom, void* top);
/* Push everything in a range */
/* onto mark stack. */
void GC_push_selected GC_PROTO(( \
@@ -1960,6 +1975,10 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
/* some other reason. */
# endif /* PARALLEL_MARK */
#ifdef __cplusplus
} // extern "C"
#endif
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS)
/* We define the thread suspension signal here, so that we can refer */
/* to it in the dirty bit implementation, if necessary. Ideally we */

View File

@@ -1191,11 +1191,13 @@ void GC_mark_init()
* Should only be used if there is no possibility of mark stack
* overflow.
*/
void GC_push_all(bottom, top)
ptr_t bottom;
ptr_t top;
void GC_push_all(void_bottom, void_top)
void* void_bottom;
void* void_top;
{
register word length;
ptr_t bottom = (ptr_t)void_bottom;
ptr_t top = (ptr_t)void_top;
word length;
bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
top = (ptr_t)(((word) top) & ~(ALIGNMENT-1));