2005-03-03 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / metadata / gc-internal.h
index c4670acc163190ebf4c4483601b78242bb01bb4c..c4dd4dd805bdf74e333692e2d105983d1ddf5e86 100644 (file)
@@ -29,6 +29,13 @@ extern void mono_gc_init (void);
 extern void mono_gc_cleanup (void);
 extern void mono_gc_enable (void);
 extern void mono_gc_disable (void);
+
+/*
+ * Return whenever the current thread is registered with the GC (i.e. started
+ * by the GC pthread wrappers on unix.
+ */
+extern gboolean mono_gc_is_gc_thread (void);
+
 /* only valid after the RECLAIM_START GC event and before RECLAIM_END
  * Not exported in public headers, but can be linked to (unsupported).
  */
@@ -37,5 +44,24 @@ extern gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
 extern gpointer mono_gc_out_of_memory (size_t size);
 extern void     mono_gc_enable_events (void);
 
+/* disappearing link functionality */
+void        mono_gc_weak_link_add    (void **link_addr, MonoObject *obj);
+void        mono_gc_weak_link_remove (void **link_addr);
+MonoObject *mono_gc_weak_link_get    (void **link_addr);
+
+/* simple interface for data structures needed in the runtime */
+void* mono_gc_make_descr_from_bitmap (unsigned int *bitmap, int numbits);
+/* desc is the result from mono_gc_make_descr*. A NULL value means
+ * all the words contain GC pointers.
+ * The memory is non-moving and it will be explicitly deallocated.
+ * size bytes will be available from the returned address (ie, descr
+ * must not be stored in the returned memory)
+ */
+void* mono_gc_alloc_fixed            (size_t size, void *descr);
+void  mono_gc_free_fixed             (void* addr);
+
+/* make sure the gchandle was allocated for an object in domain */
+gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain);
+
 #endif /* __MONO_METADATA_GC_H__ */