Skip to content

Commit

Permalink
GC: Correctly align exclusive_sync.alloc_objects (#67799)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
creator1creeper1 committed Apr 9, 2022
1 parent 1276f01 commit 93c7c89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 93c7c89

Please sign in to comment.