refactor: udp

This commit is contained in:
世界
2022-06-09 21:16:42 +08:00
parent cd466f05d3
commit 637a8b6ed5
23 changed files with 231 additions and 127 deletions

View File

@@ -6,9 +6,15 @@ import (
"errors"
"math/bits"
"sync"
"github.com/sagernet/sing/common/buf"
)
var DefaultAllocator = NewAllocator()
var defaultAllocator = NewAllocator()
func init() {
buf.DefaultAllocator = defaultAllocator
}
// Allocator for incoming frames, optimized to prevent overwriting after zeroing
type Allocator struct {