[sgen] Fixed compilation of sgen-workers.c under MSVC.
authorJoao Matos <joao.matos@xamarin.com>
Mon, 25 May 2015 18:33:26 +0000 (19:33 +0100)
committerJoao Matos <joao.matos@xamarin.com>
Mon, 25 May 2015 18:40:07 +0000 (19:40 +0100)
mono/sgen/sgen-workers.c

index e7a003bcad1b523b8f9bd06f8b46b144b55bde3f..613f332cca4398e68c9b3b45b7ae5a4c8da8f14f 100644 (file)
@@ -314,7 +314,7 @@ void
 sgen_workers_init (int num_workers)
 {
        int i;
-       void *workers_data_ptrs [num_workers];
+       void **workers_data_ptrs = alloca(num_workers * sizeof(void *));
 
        if (!sgen_get_major_collector ()->is_concurrent) {
                sgen_thread_pool_init (num_workers, thread_pool_init_func, NULL, NULL, NULL);
@@ -331,7 +331,7 @@ sgen_workers_init (int num_workers)
        init_distribute_gray_queue ();
 
        for (i = 0; i < workers_num; ++i)
-               workers_data_ptrs [i] = &workers_data [i];
+               workers_data_ptrs [i] = (void *) &workers_data [i];
 
        sgen_thread_pool_init (num_workers, thread_pool_init_func, marker_idle_func, continue_idle_func, workers_data_ptrs);