On Mon Feb 13 23:04:41 2023 +0000, Zebediah Figura wrote:
I really don't like the idea of using memory barriers when they're not actually protecting anything, but if we must have them, can we please document this in the code, for the next person that needs to ask why we have them?
The acq/rel barrier on the `enabled` flag is protecting `compat_info` (i.e. `compat_info := LFH` happens-before `enabled := TRUE`), so that a caller that observes LFH block allocation (alloc request succeeds without heap lock) will never observe `HEAP_STD` when it queries the heap.
This requirement should be documented in the release side, along with a note that says the the `compat_info` write and `enabled` write should not change order.