package main

import (
	"sync"
)

var (
	defaultBuffPool = bufferPool{
		p: &sync.Pool{
			New: func() interface{} {
				return make([]byte, SYS_BUF_SIZE) //2k缓冲
			},
		},
	}
)

type bufferPool struct {
	p *sync.Pool
}

func (b *bufferPool) Get() []byte {
	return b.p.Get().([]byte)
}

func (b *bufferPool) put(data []byte) { // 小写？
	b.p.Put(data)
}
