/* Win64 isn't really supported yet, but this is the first step. And */
/* it might cause error messages to show up in more plausible places. */
/* This needs basetsd.h, which is included by windows.h. */
- typedef ULONG_PTR GC_word;
- typedef LONG_PTR GC_word;
+ #include <stdint.h>
+ typedef unsigned __int64 GC_word;
+ typedef __int64 GC_signed_word;
#endif
/* Public read-only variables */
GC_EVENT_MARK_END,
GC_EVENT_RECLAIM_START,
GC_EVENT_RECLAIM_END,
- GC_EVENT_END
+ GC_EVENT_END,
+ GC_EVENT_PRE_STOP_WORLD,
+ GC_EVENT_POST_STOP_WORLD,
+ GC_EVENT_PRE_START_WORLD,
+ GC_EVENT_POST_START_WORLD
} GCEventType;
GC_API void (*GC_notify_event) GC_PROTO((GCEventType event_type));
/* Never decreases, except due to wrapping. */
GC_API size_t GC_get_total_bytes GC_PROTO((void));
+/* Return the signal used by the gc to suspend threads on posix platforms. */
+/* Return -1 otherwise. */
+int GC_get_suspend_signal GC_PROTO((void));
+
+/* Return the signal used by the gc to resume threads on posix platforms. */
+/* Return -1 otherwise. */
+int GC_get_restart_signal GC_PROTO((void));
+
/* Disable garbage collection. Even GC_gcollect calls will be */
/* ineffective. */
GC_API void GC_disable GC_PROTO((void));
# define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p)
# define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \
GC_general_register_disappearing_link(link, GC_base(obj))
+# define GC_REGISTER_LONG_LINK(link, obj) \
+ GC_register_long_link(link, GC_base(obj))
# define GC_REGISTER_DISPLACEMENT(n) GC_debug_register_displacement(n)
# else
# define GC_MALLOC(sz) GC_malloc(sz)
# define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p)
# define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \
GC_general_register_disappearing_link(link, obj)
+# define GC_REGISTER_LONG_LINK(link, obj) \
+ GC_register_long_link(link, obj)
# define GC_REGISTER_DISPLACEMENT(n) GC_register_displacement(n)
# endif
/* The following are included because they are often convenient, and */
/* Undoes a registration by either of the above two */
/* routines. */
+GC_API int GC_register_long_link GC_PROTO((GC_PTR * /* link */, GC_PTR obj));
+GC_API int GC_unregister_long_link GC_PROTO((GC_PTR * /* link */));
+
+
+/* toggleref support */
+GC_API void GC_toggleref_register_callback GC_PROTO((int (*proccess_toggleref) (GC_PTR obj)));
+GC_API void GC_toggleref_add (GC_PTR object, int strong_ref);
+
+/* finalizer callback support */
+GC_API void GC_set_finalizer_notify_proc GC_PROTO((void (*object_finalized) (GC_PTR obj)));
+
+
/* Returns !=0 if GC_invoke_finalizers has something to do. */
GC_API int GC_should_invoke_finalizers GC_PROTO((void));
/* Returns 1 if the calling thread is registered with the GC, 0 otherwise */
GC_API int GC_thread_is_registered GC_PROTO((void));
+/* Notify the collector about the stack and the altstack of the current thread */
+/* STACK/STACK_SIZE is used to determine the stack dimensions when a thread is
+ * suspended while it is on an altstack.
+ */
+GC_API void GC_register_altstack GC_PROTO((void *stack, int stack_size, void *altstack, int altstack_size));
+
/* Safer, but slow, pointer addition. Probably useful mainly with */
/* a preprocessor. Useful only for heap pointers. */
#ifdef GC_DEBUG
#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
# include <windows.h>
+ BOOL WINAPI GC_DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved);
+
/*
* All threads must be created using GC_CreateThread, so that they will be
* recorded in the thread table. For backwards compatibility, this is not