Libraryless. Click here for Pure Java version (3939L/23K).
1 | static long bytesAllocated(Runnable etc r) { |
2 | if (!threadAllocatedMemorySane()) ret -1; |
3 | long value1 = bytesAllocatedByCurrentThread(); |
4 | pcall { if (r != null) r.run(); } |
5 | long value2 = bytesAllocatedByCurrentThread(); |
6 | ret value2-value1; |
7 | } |
Began life as a copy of #1033098
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033099 |
Snippet name: | bytesAllocated |
Eternal ID of this version: | #1033099/5 |
Text MD5: | b11e613596515c5ad3e8afc8012f38ac |
Transpilation MD5: | 42810d3b10a13420587c84711299ad3b |
Author: | stefan |
Category: | javax / monitoring |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-14 16:06:46 |
Source code size: | 251 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 140 / 214 |
Version history: | 4 change(s) |
Referenced in: | [show references] |