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.

pools.go 245B

123456789101112131415161718
  1. package record
  2. import "sync"
  3. var recordPool = sync.Pool{
  4. New: func() interface{} {
  5. return &Record{}
  6. },
  7. }
  8. func AcquireRecord() *Record {
  9. return recordPool.Get().(*Record)
  10. }
  11. func ReleaseRecord(r *Record) {
  12. r.Reset()
  13. recordPool.Put(r)
  14. }