static WorkerData workers_gc_thread_data;
static GrayQueue workers_distribute_gray_queue;
-static SgenInternalAllocator workers_distribute_gray_queue_allocator;
#define WORKERS_DISTRIBUTE_GRAY_QUEUE (major_collector.is_parallel ? &workers_distribute_gray_queue : &gray_queue)
}
static void
-workers_enqueue_job (SgenInternalAllocator *allocator, JobFunc func, void *data)
+workers_enqueue_job (JobFunc func, void *data)
{
int num_entries;
JobQueueEntry *entry;
return;
}
- entry = mono_sgen_alloc_internal_fixed (allocator, INTERNAL_MEM_JOB_QUEUE_ENTRY);
+ entry = mono_sgen_alloc_internal (INTERNAL_MEM_JOB_QUEUE_ENTRY);
entry->func = func;
entry->data = data;
return FALSE;
entry->func (data, entry->data);
- mono_sgen_free_internal_delayed (entry, INTERNAL_MEM_JOB_QUEUE_ENTRY, data->private_gray_queue.allocator);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_JOB_QUEUE_ENTRY);
return TRUE;
}
if (section->end)
gray_object_enqueue_section (queue, section);
else
- gray_object_free_queue_section (section, queue->allocator);
+ gray_object_free_queue_section (section);
}
if (data != &workers_gc_thread_data && gray_object_queue_is_empty (queue))
workers_thread_func (void *data_untyped)
{
WorkerData *data = data_untyped;
- SgenInternalAllocator allocator;
if (major_collector.init_worker_thread)
major_collector.init_worker_thread (data->major_collector_data);
- memset (&allocator, 0, sizeof (allocator));
-#ifdef SGEN_DEBUG_INTERNAL_ALLOC
- allocator.thread = pthread_self ();
-#endif
-
- gray_object_queue_init_with_alloc_prepare (&data->private_gray_queue, &allocator,
+ gray_object_queue_init_with_alloc_prepare (&data->private_gray_queue,
workers_gray_queue_share_redirect, data);
for (;;) {
workers_gray_queue_share_redirect (&data->private_gray_queue);
g_assert (gray_object_queue_is_empty (&data->private_gray_queue));
- gray_object_queue_init (&data->private_gray_queue, &allocator);
+ gray_object_queue_init (&data->private_gray_queue);
did_work = TRUE;
}
static void
workers_init_distribute_gray_queue (void)
{
- if (!major_collector.is_parallel) {
-#ifdef SGEN_DEBUG_INTERNAL_ALLOC
- mono_sgen_get_unmanaged_allocator ()->thread = pthread_self ();
-#endif
+ if (!major_collector.is_parallel)
return;
- }
- gray_object_queue_init (&workers_distribute_gray_queue, &workers_distribute_gray_queue_allocator);
-#ifdef SGEN_DEBUG_INTERNAL_ALLOC
- workers_distribute_gray_queue_allocator.thread = pthread_self ();
-#endif
+ gray_object_queue_init (&workers_distribute_gray_queue);
}
static void
MONO_SEM_INIT (&workers_waiting_sem, 0);
MONO_SEM_INIT (&workers_done_sem, 0);
- gray_object_queue_init_with_alloc_prepare (&workers_distribute_gray_queue, &workers_distribute_gray_queue_allocator,
+ gray_object_queue_init_with_alloc_prepare (&workers_distribute_gray_queue,
workers_gray_queue_share_redirect, &workers_gc_thread_data);
pthread_mutex_init (&workers_gc_thread_data.stealable_stack_mutex, NULL);
workers_gc_thread_data.stealable_stack_fill = 0;
{
int i;
- if (!major_collector.is_parallel) {
-#ifdef SGEN_DEBUG_INTERNAL_ALLOC
- mono_sgen_get_unmanaged_allocator ()->thread = NULL;
-#endif
+ if (!major_collector.is_parallel)
return;
- }
g_assert (gray_object_queue_is_empty (&workers_gc_thread_data.private_gray_queue));
g_assert (gray_object_queue_is_empty (&workers_distribute_gray_queue));