set flag useNewPing.
static A memLimit(long allocationLimit, IF0 f) {
if (f == null) null;
long baseline = bytesAllocatedByCurrentThread();
long limit = baseline+allocationLimit;
temp tempNewPing_addToStack(r {
if (bytesAllocatedByCurrentThread() > limit)
fail("Memory limit exceeded: " + toM(allocationLimit));
});
A a = f.get();
ping();
ret a;
}