/* Functions supplied by the runtime to be called by the GC */
static MonoGCCallbacks gc_callbacks;
-/* The total number of bytes allocated so far in program exection.
+/* The total number of bytes allocated so far in program exection by all attached threads.
* This is not constantly syncrhonized, but only updated on each GC. */
-static guint64 total_bytes_allocated = 0;
+static guint64 bytes_allocated_attached = 0;
+
+/* Total bytes allocated so far in program exevution by detached threads */
+static guint64 bytes_allocated_detached = 0;
#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
a = i,
mono_tls_set_sgen_thread_info (NULL);
+ bytes_allocated_detached += p->total_bytes_allocated;
+
tid = mono_thread_info_get_tid (p);
mono_threads_add_joinable_runtime_thread (&p->client_info.info);
}
void
-sgen_set_total_bytes_allocated(guint64 bytes)
+sgen_set_bytes_allocated_attached(guint64 bytes)
{
- total_bytes_allocated = bytes;
+ bytes_allocated_attached = bytes;
}
guint64
mono_gc_restart_world();
}
- return total_bytes_allocated;
+ return bytes_allocated_attached + bytes_allocated_detached;
}
info->tlab_real_end = NULL;
} FOREACH_THREAD_END
- sgen_set_total_bytes_allocated(total_bytes_allocated_globally);
+ sgen_set_bytes_allocated_attached(total_bytes_allocated_globally);
}
void sgen_update_allocation_count (void)
total_bytes_allocated_globally += info->total_bytes_allocated;
} FOREACH_THREAD_END
- sgen_set_total_bytes_allocated(total_bytes_allocated_globally);
+ sgen_set_bytes_allocated_attached(total_bytes_allocated_globally);
}
gboolean sgen_collection_is_concurrent (void);
gboolean sgen_get_concurrent_collection_in_progress (void);
-void sgen_set_total_bytes_allocated(guint64);
+void sgen_set_bytes_allocated_attached(guint64);
typedef struct _SgenFragment SgenFragment;