ld64 in the macOS 10.15 SDK gives __DATA a maxprot of 3, meaning it can't be made executable at runtime by default.
Change clear_cache_test.c to use mmap()ed data that's mapped as writable and executable from the beginning, instead of trying to mprotect()ing a __DATA variable as executable. This fixes the test on macOS with the 10.15 SDK.
PR43407.
I don't like repetition of the 128 constant. We could define a global const (e.g. kExecutionBufferSize) and use it here.
However, we aren't using page_size anymore here and arguably we could use it here instead of 128 (which seems like a really arbitrary size). However, mmap has to round up to the page size anyway so maybe dropping page_size and the code that computes it is the cleanest thing to do?