static long bytesAllocated(Runnable etc r) { if (!threadAllocatedMemorySane()) ret -1; long value1 = bytesAllocatedByCurrentThread(); pcallF(r); long value2 = bytesAllocatedByCurrentThread(); ret value2-value1; }