GC_set_on_collection_event (on_gc_notification);
GC_on_heap_resize = on_gc_heap_resize;
- MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_NORMAL].entries, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table");
- MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_PINNED].entries, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table");
-
gc_initialized = TRUE;
}
return TRUE;
}
+int
+mono_gc_register_root_wbarrier (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg)
+{
+ return mono_gc_register_root (start, size, descr, source, msg);
+}
+
void
mono_gc_deregister_root (char* addr)
{
void*
mono_gc_alloc_fixed (size_t size, void *descr, MonoGCRootSource source, const char *msg)
{
- /* To help track down typed allocation bugs */
- /*
- static int count;
- count ++;
- if (count == atoi (g_getenv ("COUNT2")))
- printf ("HIT!\n");
- if (count > atoi (g_getenv ("COUNT2")))
- return GC_MALLOC (size);
- */
-
- if (descr)
- return GC_MALLOC_EXPLICITLY_TYPED (size, (GC_descr)descr);
- else
- return GC_MALLOC (size);
+ return GC_MALLOC_UNCOLLECTABLE (size);
}
void
mono_gc_free_fixed (void* addr)
{
+ GC_FREE (addr);
}
void *
}
#if defined(USE_COMPILER_TLS) && defined(__linux__) && (defined(__i386__) || defined(__x86_64__))
-extern __thread MONO_TLS_FAST void* GC_thread_tls;
+extern __thread void* GC_thread_tls;
#include "metadata-internals.h"
static int
const char *name = NULL;
WrapperInfo *info;
+ g_assert_not_reached ();
+
if (atype == ATYPE_FREEPTR) {
name = slowpath ? "SlowAllocPtrfree" : "AllocPtrfree";
} else if (atype == ATYPE_FREEPTR_FOR_BOX) {
MonoMethod*
mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box, gboolean known_instance_size)
{
- int offset = -1;
int atype;
- MONO_THREAD_VAR_OFFSET (GC_thread_tls, offset);
- /*g_print ("thread tls: %d\n", offset);*/
- if (offset == -1)
- return NULL;
+ /*
+ * Tls implementation changed, we jump to tls native getters/setters.
+ * Is boehm managed allocator ok with this ? Do we even care ?
+ */
+ return NULL;
+
if (!SMALL_ENOUGH (klass->instance_size))
return NULL;
if (mono_class_has_finalizer (klass) || mono_class_is_marshalbyref (klass))
MonoMethod*
mono_gc_get_managed_allocator_by_type (int atype, ManagedAllocatorVariant variant)
{
- int offset = -1;
MonoMethod *res;
gboolean slowpath = variant != MANAGED_ALLOCATOR_REGULAR;
MonoMethod **cache = slowpath ? slowpath_alloc_method_cache : alloc_method_cache;
- MONO_THREAD_VAR_OFFSET (GC_thread_tls, offset);
- mono_tls_key_set_offset (TLS_KEY_BOEHM_GC_THREAD, offset);
+ return NULL;
res = cache [atype];
if (res)
return res;
- res = create_allocator (atype, TLS_KEY_BOEHM_GC_THREAD, slowpath);
+ res = create_allocator (atype, -1, slowpath);
mono_os_mutex_lock (&mono_gc_lock);
if (cache [atype]) {
mono_free_method (res);