guint64
mono_gc_get_total_allocated_bytes(MonoBoolean precise)
{
- return total_bytes_allocated;
+ if (precise)
+ {
+ mono_threads_begin_global_suspend();
+ guint64 count = sgen_updated_allocation_count();
+ mono_threads_end_global_suspend();
+ return count;
+ }
+
+ return total_bytes_allocated
}
+
+
+
gpointer
sgen_client_default_metadata (void)
{
sgen_set_total_bytes_allocated(total_bytes_allocated_globally);
}
+void sgen_update_allocation_count (void)
+{
+ guint64 total_bytes_allocated_globally = 0;
+
+ FOREACH_THREAD_ALL (info) {
+ total_bytes_allocated_globally += info->tlab_next - info->tlab_start;
+ total_bytes_allocated_globally += info->total_bytes_allocated;
+ } FOREACH_THREAD_END
+
+ sgen_set_total_bytes_allocated(total_bytes_allocated_globally);
+}
+
+
void
sgen_init_allocator (void)
{
}
}
+guint64 sgen_get_precise_allocation_count (void)
+{
+
+}
+
#endif /* HAVE_SGEN_GC */
void
sgen_check_canary_for_object (gpointer addr);
+guint64 sgen_get_precise_allocation_count (void);
+
#define CHECK_CANARY_FOR_OBJECT(addr, ignored) \
(sgen_nursery_canaries_enabled () ? sgen_check_canary_for_object (addr) : (void)0)