#include <mono/metadata/gc-internals.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-lazy-init.h>
+#include <mono/utils/mono-threads.h>
#define HANDLES_PER_CHUNK (16 - 2)
MonoHandleArena*
mono_handle_arena_current (void)
{
- g_assert_not_reached ();
+ return (MonoHandleArena*) mono_thread_info_current ()->handle_arena;
}
MonoHandleArena**
mono_handle_arena_current_addr (void)
{
- g_assert_not_reached ();
+ return (MonoHandleArena**) &mono_thread_info_current ()->handle_arena;
}
#include "metadata/runtime.h"
#include "metadata/sgen-bridge-internals.h"
#include "metadata/gc-internals.h"
+#include "metadata/handle.h"
#include "utils/mono-memory-model.h"
#include "utils/mono-logger-internals.h"
static void
sgen_thread_attach (SgenThreadInfo *info)
{
+ mono_handle_arena_initialize ((MonoHandleArena**) &info->client_info.info.handle_arena);
+
if (mono_gc_get_gc_callbacks ()->thread_attach_func && !info->client_info.runtime_data)
info->client_info.runtime_data = mono_gc_get_gc_callbacks ()->thread_attach_func ();
}
*/
if (mono_domain_get ())
mono_thread_detach_internal (mono_thread_internal_current ());
+
+ mono_handle_arena_deinitialize ((MonoHandleArena**) &p->client_info.info.handle_arena);
}
gboolean