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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. package relay
  2. import "sync"
  3. var bufPool = sync.Pool{
  4. New: func() any {
  5. b := make([]byte, bufPoolSize)
  6. return &b
  7. },
  8. }
  9. func acquireBuffer() *[]byte {
  10. return bufPool.Get().(*[]byte)
  11. }
  12. func releaseBuffer(p *[]byte) {
  13. bufPool.Put(p)
  14. }