Documentation ¶
Overview ¶
Package memorypool includes useful tools for creating common data structures in eth2 with optimal memory allocation.
Index ¶
- Variables
- func GetDoubleByteSlice(size int) [][]byte
- func GetRandaoMixesTrie(size int) [][]*[32]byte
- func GetRootsTrie(size int) [][]*[32]byte
- func GetValidatorsTrie(size int) [][]*[32]byte
- func PutDoubleByteSlice(data [][]byte)
- func PutRandaoMixesTrie(data [][]*[32]byte)
- func PutRootsTrie(data [][]*[32]byte)
- func PutValidatorsTrie(data [][]*[32]byte)
Constants ¶
This section is empty.
Variables ¶
var DoubleByteSlicePool = new(sync.Pool)
DoubleByteSlicePool represents the memory pool for 2d byte slices.
var RandaoMixesMemoryPool = new(sync.Pool)
RandaoMixesMemoryPool represents the memory pool for randao mixes trie.
var RootsMemoryPool = new(sync.Pool)
RootsMemoryPool represents the memory pool for state roots/block roots trie.
var ValidatorsMemoryPool = new(sync.Pool)
ValidatorsMemoryPool represents the memory pool for 3d byte slices.
Functions ¶
func GetDoubleByteSlice ¶
GetDoubleByteSlice retrieves the 2d byte slice of the desired size from the memory pool.
func GetRandaoMixesTrie ¶ added in v0.3.5
GetRandaoMixesTrie retrieves the 3d byte slice of the desired size from the memory pool.
func GetRootsTrie ¶
GetRootsTrie retrieves the 3d byte trie of the desired size from the memory pool.
func GetValidatorsTrie ¶
GetValidatorsTrie retrieves the 3d byte slice of the desired size from the memory pool.
func PutDoubleByteSlice ¶
func PutDoubleByteSlice(data [][]byte)
PutDoubleByteSlice places the provided 2d byte slice in the memory pool.
func PutRandaoMixesTrie ¶ added in v0.3.5
func PutRandaoMixesTrie(data [][]*[32]byte)
PutRandaoMixesTrie places the provided 3d byte slice in the memory pool.
func PutRootsTrie ¶
func PutRootsTrie(data [][]*[32]byte)
PutRootsTrie places the provided 3d byte trie in the memory pool.
func PutValidatorsTrie ¶
func PutValidatorsTrie(data [][]*[32]byte)
PutValidatorsTrie places the provided 3d byte slice in the memory pool.
Types ¶
This section is empty.