Revert "Revert "Improve immune spaces logic""

Test was flaky due to missing guard page at the end of the region.

Bug: 27136196

This reverts commit 07dbbca0b42cb8da1811de8209b4a7d4becfc7b2.

(cherry picked from commit 032c0051eb47f1f62586602894e5833356f4f9ec)

Change-Id: I7f9fcb0785ec45aaeded8ed65b7fa1abcf798282
2 files changed