mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-05 09:36:19 +00:00
Don't warn when allocating 0 bytes
I was able to reproduce this by starting two computers, and then warming up the JIT by running: while true do os.queueEvent("x") os.pullEvent("x") end and then running the following on one computer, while typing on the other: while true do end I'm not quite sure why this happens. It's possible that once the JIT is warm, we can resume computers without actually allocating anything, though I'm a little unconvinced. Fixes #1672
This commit is contained in:
parent
272010e945
commit
133b51b092
@ -835,8 +835,8 @@ public final class ComputerThread implements ComputerScheduler {
|
||||
var allocated = ThreadAllocations.getAllocatedBytes(current) - info.allocatedBytes();
|
||||
if (allocated > 0) {
|
||||
metrics.observe(Metrics.JAVA_ALLOCATION, allocated);
|
||||
} else {
|
||||
LOG.warn("Allocated a negative number of bytes!");
|
||||
} else if (allocated < 0) {
|
||||
LOG.warn("Allocated a negative number of bytes ({})!", allocated);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user