Chore: use iife replace init in some cases

This commit is contained in:
Dreamacro
2021-07-11 19:42:54 +08:00
parent 250a9f4f84
commit 46f4f84442
3 changed files with 13 additions and 21 deletions

View File

@ -8,11 +8,7 @@ import (
"sync"
)
var defaultAllocator *Allocator
func init() {
defaultAllocator = NewAllocator()
}
var defaultAllocator = NewAllocator()
// Allocator for incoming frames, optimized to prevent overwriting after zeroing
type Allocator struct {