Commit 18fb91d8 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Early exit for FreeBuffer(nil)

parent 6c878f73
...@@ -120,6 +120,9 @@ func (me *BufferPool) AllocBuffer(size uint32) []byte { ...@@ -120,6 +120,9 @@ func (me *BufferPool) AllocBuffer(size uint32) []byte {
// AllocBuffer. It is not an error to call FreeBuffer() on a slice // AllocBuffer. It is not an error to call FreeBuffer() on a slice
// obtained elsewhere. // obtained elsewhere.
func (me *BufferPool) FreeBuffer(slice []byte) { func (me *BufferPool) FreeBuffer(slice []byte) {
if slice == nil {
return
}
sz := cap(slice) sz := cap(slice)
if sz < PAGESIZE { if sz < PAGESIZE {
return return
......
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