Merge pull request #2379 from xmcclure/babysitter-contd
[mono.git] / mono / metadata / mono-gc.h
index 689cad28a88b142337ea997146cace72324c5283..e1455148696b130e5e21dffd5c0d4eaa56ad9815 100644 (file)
@@ -11,6 +11,39 @@ MONO_BEGIN_DECLS
 
 typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data);
 
+typedef enum {
+       // Roots external to Mono.  Embedders may only use this value.
+       MONO_ROOT_SOURCE_EXTERNAL = 0,
+       // Thread stack.  Must not be used to register roots.
+       MONO_ROOT_SOURCE_STACK = 1,
+       // Roots in the finalizer queue.  Must not be used to register roots.
+       MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
+       // Managed static variables.
+       MONO_ROOT_SOURCE_STATIC = 3,
+       // Static variables with ThreadStaticAttribute.
+       MONO_ROOT_SOURCE_THREAD_STATIC = 4,
+       // Static variables with ContextStaticAttribute.
+       MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
+       // GCHandle structures.
+       MONO_ROOT_SOURCE_GC_HANDLE = 6,
+       // Roots in the just-in-time compiler.
+       MONO_ROOT_SOURCE_JIT = 7,
+       // Roots in the threading subsystem.
+       MONO_ROOT_SOURCE_THREADING = 8,
+       // Roots in application domains.
+       MONO_ROOT_SOURCE_DOMAIN = 9,
+       // Roots in reflection code.
+       MONO_ROOT_SOURCE_REFLECTION = 10,
+       // Roots from P/Invoke or other marshaling.
+       MONO_ROOT_SOURCE_MARSHAL = 11,
+       // Roots in the thread pool data structures.
+       MONO_ROOT_SOURCE_THREAD_POOL = 12,
+       // Roots in the debugger agent.
+       MONO_ROOT_SOURCE_DEBUGGER = 13,
+       // Handle structures, used for object passed to internal functions
+       MONO_ROOT_SOURCE_HANDLE = 14,
+} MonoGCRootSource;
+
 MONO_API void   mono_gc_collect         (int generation);
 MONO_API int    mono_gc_max_generation  (void);
 MONO_API int    mono_gc_get_generation  (MonoObject *object);