return NULL;
}
+void
+mono_gc_set_current_thread_appdomain (MonoDomain *domain)
+{
+}
+
gboolean
mono_gc_precise_stack_mark_enabled (void)
{
#define SET_APPDOMAIN(x) do { \
MONO_FAST_TLS_SET (tls_appdomain,x); \
mono_native_tls_set_value (appdomain_thread_id, x); \
+ mono_gc_set_current_thread_appdomain (x); \
} while (FALSE)
#else /* !MONO_HAVE_FAST_TLS */
#define GET_APPDOMAIN() ((MonoDomain *)mono_native_tls_get_value (appdomain_thread_id))
-#define SET_APPDOMAIN(x) mono_native_tls_set_value (appdomain_thread_id, x);
+#define SET_APPDOMAIN(x) do { \
+ mono_native_tls_set_value (appdomain_thread_id, x); \
+ mono_gc_set_current_thread_appdomain (x); \
+ } while (FALSE)
#endif
void* mono_gc_get_nursery (int *shift_bits, size_t *size) MONO_INTERNAL;
+void mono_gc_set_current_thread_appdomain (MonoDomain *domain) MONO_INTERNAL;
+
/*
* Return whenever GC is disabled
*/
return NULL;
}
+void
+mono_gc_set_current_thread_appdomain (MonoDomain *domain)
+{
+}
+
gboolean
mono_gc_precise_stack_mark_enabled (void)
{
return nursery_start;
}
+void
+mono_gc_set_current_thread_appdomain (MonoDomain *domain)
+{
+ SgenThreadInfo *info = mono_thread_info_current ();
+ g_assert (info);
+ info->stopped_domain = domain;
+}
+
gboolean
mono_gc_precise_stack_mark_enabled (void)
{
*/
//#define XDOMAIN_CHECKS_IN_WBARRIER
-#ifndef HOST_WIN32
#ifndef SGEN_BINARY_PROTOCOL
#ifndef HEAVY_STATISTICS
#define MANAGED_ALLOCATION
#endif
#endif
#endif
-#endif
static gboolean
is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip);
* CEE_MONO_TLS requires the tls offset, not the key, so the code below only works on darwin,
* where the two are the same.
*/
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined (HOST_WIN32)
#define EMIT_TLS_ACCESS(mb,member,dummy) do { \
mono_mb_emit_byte ((mb), MONO_CUSTOM_PREFIX); \
mono_mb_emit_byte ((mb), CEE_MONO_TLS); \
CloseHandle (handle);
- info->stopped_domain = NULL; /* FIXME: implement! */
info->stopped_ip = (gpointer)context.Eip;
info->stack_start = (char*)context.Esp - REDZONE_SIZE;
int
mono_vfree (void *addr, size_t length)
{
- int res = VirtualFree (addr, 0, MEM_RELEASE);
+ MEMORY_BASIC_INFORMATION mbi;
+ SIZE_T query_result = VirtualQuery (addr, &mbi, sizeof (mbi));
+ BOOL res;
+
+ g_assert (query_result);
+
+ res = VirtualFree (mbi.AllocationBase, 0, MEM_RELEASE);
g_assert (res);