How is gas for one-way functions calculated?

Let X.f be an one-way function. Let we also have:

public shared func g(): async () {
  X.f();
};

Is gas spent by f accounted towards gas spent by g (for the purpose of 30B gas limit)?

Oh, I understood by myself:

f gas cannot be taken into account while calculating g gas, because when g returns, f may be yet running (and therefore its gas unknown).