Commit 54200cdb authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add a check for memory leaks in BufferPool.

parent dc5fe171
...@@ -109,6 +109,13 @@ func (me *BufferPool) AllocBuffer(size uint32) []byte { ...@@ -109,6 +109,13 @@ func (me *BufferPool) AllocBuffer(size uint32) []byte {
} }
me.outstandingBuffers[uintptr(unsafe.Pointer(&b[0]))] = exp me.outstandingBuffers[uintptr(unsafe.Pointer(&b[0]))] = exp
// FUSE throttles to ~10 outstanding requests, no normally,
// should not have more than 20 buffers outstanding.
if len(me.outstandingBuffers) > 200 {
panic("Leaking buffers")
}
return b return b
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment