Add a class FlagGuard that allows for easier modification of flags for unit tests. A TEST_VM unit tests that wants to change a flag simply has to create a FlagGuard:
FlagGuard g("MaxGCPauseMillis");
together with a simple macro, GUARD_FLAG, a test only has to write:
GUARD_FLAG(MaxGCPauseMillis);
and can then the test can change the flag however it wants, the flags value will be restored when the test is done.
FlagGuard g("MaxGCPauseMillis");
together with a simple macro, GUARD_FLAG, a test only has to write:
GUARD_FLAG(MaxGCPauseMillis);
and can then the test can change the flag however it wants, the flags value will be restored when the test is done.