The shadow memory initialization in tsan_platform_mac.cc needs to be updated to also initialize the meta shadow and to mprotect the memory ranges that need to be avoided. This patch moves most of the Linux implementation of InitializeShadowMemory, ProtectRange and CheckAndProtect into tsan_rt.cc so it can be reused on OS X as well.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Please shuffle code differently.
I have 2 concerns here:
- tsan_rtl.cc is already a bit of trash can, and I don't want it to continue moving in that direction (initially it was meant for abstract state-machine logic only).
- The distinction between InitializeShadowMemory and InitializeShadowMemoryPlatform is not clear, e.g. what will you put in what function on windows?
So please put the common functions into a new tsan_platform_posix.cc, put definition of CheckAndProtect into tsan_platform.h, call InitializeShadowMemoryPlatform from within InitializeShadowMemory (so that Initialize only calls InitializeShadowMemory, and then it's platform business what it does there).