Initial set of Ward sgen annotations (#5705)
[mono.git] / mono / sgen / sgen-client.h
index 6d60c3516c6a380c8a2de1c47827a34229ea853a..4137cacc3c2a94a6e26e25f77b9de57df373cef2 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * sgen-client.h: SGen client interface.
+/**
+ * \file
+ * SGen client interface.
  *
  * Copyright (C) 2014 Xamarin Inc
  *
@@ -68,13 +69,15 @@ void sgen_client_finalize_notify (void);
  * Returns TRUE if no ephemerons have been marked.  Will be called again if it returned
  * FALSE.  If ephemerons are not supported, just return TRUE.
  */
-gboolean sgen_client_mark_ephemerons (ScanCopyContext ctx);
+gboolean sgen_client_mark_ephemerons (ScanCopyContext ctx)
+    MONO_PERMIT (need (sgen_gc_locked));
 
 /*
  * Clear ephemeron pairs with unreachable keys.
  * We pass the copy func so we can figure out if an array was promoted or not.
  */
-void sgen_client_clear_unreachable_ephemerons (ScanCopyContext ctx);
+void sgen_client_clear_unreachable_ephemerons (ScanCopyContext ctx)
+    MONO_PERMIT (need (sgen_gc_locked));
 
 /*
  * May return NULL.  Must be an aligned pointer.
@@ -94,7 +97,7 @@ void sgen_client_ensure_weak_gchandles_accessible (void);
  * parts of the object based on which cards are marked, do so and return TRUE.  Otherwise,
  * return FALSE.
  */
-gboolean sgen_client_cardtable_scan_object (GCObject *obj, mword block_obj_size, guint8 *cards, ScanCopyContext ctx);
+gboolean sgen_client_cardtable_scan_object (GCObject *obj, guint8 *cards, ScanCopyContext ctx);
 
 /*
  * Called after nursery objects have been pinned.  No action is necessary.
@@ -121,7 +124,7 @@ void sgen_client_pinned_los_object (GCObject *obj);
 /*
  * Called for every degraded allocation.  No action is necessary.
  */
-void sgen_client_degraded_allocation (size_t size);
+void sgen_client_degraded_allocation (void);
 
 /*
  * Called whenever the amount of memory allocated for the managed heap changes.  No action
@@ -152,11 +155,11 @@ void sgen_client_pre_collection_checks (void);
  * Must set the thread's thread info to `info`.  If the thread's small ID was not already
  * initialized in `sgen_client_init()` (for the main thread, usually), it must be done here.
  *
- * `stack_bottom_fallback` is the value passed through via `sgen_thread_register()`.
+ * `stack_bottom_fallback` is the value passed through via `sgen_thread_attach()`.
  */
-void sgen_client_thread_register (SgenThreadInfo* info, void *stack_bottom_fallback);
+void sgen_client_thread_attach (SgenThreadInfo* info);
 
-void sgen_client_thread_unregister (SgenThreadInfo *p);
+void sgen_client_thread_detach_with_lock (SgenThreadInfo *p);
 
 /*
  * Called on each worker thread when it starts up.  Must initialize the thread's small ID.
@@ -173,8 +176,10 @@ void sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gbool
  * Stop and restart the world, i.e., all threads that interact with the managed heap.  For
  * single-threaded programs this is a nop.
  */
-void sgen_client_stop_world (int generation);
-void sgen_client_restart_world (int generation, gint64 *stw_time);
+void sgen_client_stop_world (int generation)
+    MONO_PERMIT (need (sgen_gc_locked));
+void sgen_client_restart_world (int generation, gint64 *stw_time)
+    MONO_PERMIT (need (sgen_gc_locked));
 
 /*
  * Must return FALSE.  The bridge is not supported outside of Mono.