From 93c7c896c70737fb7b81480d11bba108fb0f7660 Mon Sep 17 00:00:00 2001 From: creator1creeper1 <88212773+creator1creeper1@users.noreply.github.com> Date: Sat, 9 Apr 2022 20:06:57 +0200 Subject: [PATCH] GC: Correctly align `exclusive_sync.alloc_objects` (#67799) Previously, the calculation of the `cache_separator` size of the array failed to take the first member `rwp_object` into account. Therefore, `alloc_objects` was not properly aligned to `HS_CACHE_LINE_SIZE`. --- src/coreclr/gc/gc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index a89bf115d718b..53ff8f83b2cce 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -1107,7 +1107,7 @@ class exclusive_sync int spin_count; - uint8_t cache_separator[HS_CACHE_LINE_SIZE - sizeof (int) - sizeof (int32_t)]; + uint8_t cache_separator[HS_CACHE_LINE_SIZE - (sizeof (spin_count) + sizeof (needs_checking) + sizeof (rwp_object))]; // TODO - perhaps each object should be on its own cache line... VOLATILE(uint8_t*) alloc_objects[max_pending_allocs];