Update to MemoryUsage worker

This commit is contained in:
Aditya Ujeniya
2026-01-16 17:01:39 +01:00
parent eb09504306
commit 77a2a256e4
4 changed files with 52 additions and 13 deletions

View File

@@ -265,13 +265,9 @@ func (b *buffer) forceFreeOldest() (delme bool, n int) {
// If the previous buffer signals it should be deleted:
if delPrev {
// Unlink references
// Clear links on the dying buffer to prevent leaks
b.prev.next = nil
// Return to pool if capacity matches
if cap(b.prev.data) == BufferCap {
bufferPool.Put(b.prev)
}
b.prev.data = nil // Release the underlying float slice immediately
// Remove the link from the current buffer
b.prev = nil