Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

bytes_pool.go 270B

123456789101112131415161718192021
  1. package fake
  2. import (
  3. "bytes"
  4. "sync"
  5. )
  6. var bytesPool = sync.Pool{
  7. New: func() any {
  8. return &bytes.Buffer{}
  9. },
  10. }
  11. func acquireBuffer() *bytes.Buffer {
  12. return bytesPool.Get().(*bytes.Buffer)
  13. }
  14. func releaseBuffer(b *bytes.Buffer) {
  15. b.Reset()
  16. bytesPool.Put(b)
  17. }