library/demo: log

This commit is contained in:
xushiwei
2024-07-08 15:17:08 +08:00
parent 8db3ccce2e
commit 1d4cba9180
9 changed files with 268 additions and 79 deletions

29
internal/lib/sync/pool.go Normal file
View File

@@ -0,0 +1,29 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sync
import "unsafe"
type Pool struct {
noCopy noCopy
local unsafe.Pointer // local fixed-size per-P pool, actual type is [P]poolLocal
localSize uintptr // size of the local array
victim unsafe.Pointer // local from previous cycle
victimSize uintptr // size of victims array
// New optionally specifies a function to generate
// a value when Get would otherwise return nil.
// It may not be changed concurrently with calls to Get.
New func() any
}
func (p *Pool) Put(x any) {
}
func (p *Pool) Get() any {
return p.New()
}