mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-02 00:11:56 +03:00
Add server side of things
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
bytesPool = sync.Pool{
|
||||
New: func() any {
|
||||
return &bytes.Buffer{}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func acquireBuffer() *bytes.Buffer {
|
||||
return bytesPool.Get().(*bytes.Buffer)
|
||||
}
|
||||
|
||||
func releaseBuffer(b *bytes.Buffer) {
|
||||
b.Reset()
|
||||
bytesPool.Put(b)
|
||||
}
|
||||
Reference in New Issue
Block a user