[wasm] We can't free memory in wasm as it uses the malloc mmap backend.
[mono.git] / mono / sgen / sgen-marksweep.c
index 35e1195dbfbbfc27c96546a05684c22ad1b6fa3e..3f14d5ee7acab33c1d35ccb0b84b3640bc9eb7e8 100644 (file)
@@ -189,10 +189,15 @@ enum {
        SWEEP_STATE_COMPACTING
 };
 
+typedef enum {
+       SGEN_SWEEP_SERIAL = FALSE,
+       SGEN_SWEEP_CONCURRENT = TRUE,
+} SgenSweepMode;
+
 static volatile int sweep_state = SWEEP_STATE_SWEPT;
 
 static gboolean concurrent_mark;
-static gboolean concurrent_sweep = TRUE;
+static gboolean concurrent_sweep = DEFAULT_SWEEP_MODE;
 
 int sweep_pool_context = -1;
 
@@ -1220,7 +1225,7 @@ major_get_and_reset_num_major_objects_marked (void)
 #endif
 
 /* gcc 4.2.1 from xcode4 crashes on sgen_card_table_get_card_address () when this is enabled */
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
 #if MONO_GNUC_VERSION <= 40300
 #undef PREFETCH_CARDS
 #endif
@@ -2162,7 +2167,7 @@ major_free_swept_blocks (size_t section_reserve)
 {
        SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
 
-#if defined(HOST_WIN32) || defined(HOST_ORBIS)
+#if defined(HOST_WIN32) || defined(HOST_ORBIS) || defined (HOST_WASM)
                /*
                 * sgen_free_os_memory () asserts in mono_vfree () because windows doesn't like freeing the middle of
                 * a VirtualAlloc ()-ed block.