mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
arena: add experimental arena package
This change adds the arenas package and a function to reflect for allocating from an arena via reflection, but all the new API is placed behind a GOEXPERIMENT. For #51317. Change-Id: I026d46294e26ab386d74625108c19a0024fbcedc Reviewed-on: https://go-review.googlesource.com/c/go/+/423361 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
7866538d25
commit
e0d01b8467
11 changed files with 451 additions and 1 deletions
|
|
@ -1671,6 +1671,10 @@ func GlobalWaitingArenaChunks() int {
|
|||
return n
|
||||
}
|
||||
|
||||
func UserArenaClone[T any](s T) T {
|
||||
return arena_heapify(s).(T)
|
||||
}
|
||||
|
||||
var AlignUp = alignUp
|
||||
|
||||
// BlockUntilEmptyFinalizerQueue blocks until either the finalizer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue