Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix code cache segment race condition
The first two fields of a TR::CodeCache data structures are `_warmCodeAlloc` and `_coldCodeAlloc` and they used by a third party (e.g. the JVM) to compute the amount of free space in the code cache. During the TR::CodeCache initialization we populate the _warmCodeAlloc and _coldCodeAlloc fields and then write a pointer to the TR::CodeCache structure at the beginning of the segment that provides memory for the code cache itself. Just before writing this pointer we need to issue a write memory barrier to ensure that the values of _warmCodeAlloc and _coldCodeAlloc are seen by another thread at the time when the pointer to the TR::CodeCache is written at the begining of the memory segment. Signed-off-by: Marius <[email protected]>
- Loading branch information