On Tue, 19 Mar 2024 15:17:50 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
> > Not necessarily. It may well remove some transitions from paths that don't > > need it, but if you move the state change too low down the call chain you > > could end up transitioning much more often in code that does need it e.g. > > if a transitioning method is called in a loop. > > Not if you do the switching lazily. The first iteration would switch to the > needed state; subsequent iterations would not do anything since the state > already matches. Unless you interleave writes and execs, but then you would > need the state changes anyway. Exactly. You do the transition when it's needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/18238#issuecomment-2008070652