@@ -7258,17 +7258,6 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,
7258
7258
g_card_table = translated_ct;
7259
7259
}
7260
7260
7261
- // We need to make sure that other threads executing checked write barriers
7262
- // will see the g_card_table update before g_lowest/highest_address updates.
7263
- // Otherwise, the checked write barrier may AV accessing the old card table
7264
- // with address that it does not cover. Write barriers access card table
7265
- // without memory barriers for performance reasons, so we need to flush
7266
- // the store buffers here.
7267
- GCToOSInterface::FlushProcessWriteBuffers();
7268
-
7269
- g_lowest_address = saved_g_lowest_address;
7270
- VolatileStore(&g_highest_address, saved_g_highest_address);
7271
-
7272
7261
if (!write_barrier_updated)
7273
7262
{
7274
7263
// This passes a bool telling whether we need to switch to the post
@@ -7282,6 +7271,17 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,
7282
7271
StompWriteBarrierResize(!!IsSuspendEEThread(), la != saved_g_lowest_address);
7283
7272
}
7284
7273
7274
+ // We need to make sure that other threads executing checked write barriers
7275
+ // will see the g_card_table update before g_lowest/highest_address updates.
7276
+ // Otherwise, the checked write barrier may AV accessing the old card table
7277
+ // with address that it does not cover. Write barriers access card table
7278
+ // without memory barriers for performance reasons, so we need to flush
7279
+ // the store buffers here.
7280
+ GCToOSInterface::FlushProcessWriteBuffers();
7281
+
7282
+ g_lowest_address = saved_g_lowest_address;
7283
+ VolatileStore(&g_highest_address, saved_g_highest_address);
7284
+
7285
7285
return 0;
7286
7286
7287
7287
fail:
0 commit comments