go1.20.5
GoThrough

arena.Clone

// Clone makes a shallow copy of the input value that is no longer bound to any // arena it may have been allocated from, returning the copy. If it was not // allocated from an arena, it is returned untouched. This function is useful // to more easily let an arena-allocated value out-live its arena. // T must be a pointer, a slice, or a string, otherwise this function will panic. func Clone(s T) T

arena.MakeSlice

// MakeSlice creates a new []T with the provided capacity and length. The []T must // not be used after the arena is freed. Accessing the underlying storage of the // slice after free may result in a fault, but this fault is also not guaranteed. func MakeSlice(a *Arena, len int, cap int) []T

arena.New

// New creates a new *T in the provided arena. The *T must not be used after // the arena is freed. Accessing the value after free may result in a fault, // but this fault is also not guaranteed. func New(a *Arena) *T

arena.NewArena

// NewArena allocates a new arena. func NewArena() *Arena