memorypool

package
v0.0.0-...-d79950a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package memorypool includes useful tools for creating common data structures in eth2 with optimal memory allocation.

Index

Constants

This section is empty.

Variables

View Source
var DoubleByteSlicePool = new(sync.Pool)

DoubleByteSlicePool represents the memory pool for 2d byte slices.

View Source
var RandaoMixesMemoryPool = new(sync.Pool)

RandaoMixesMemoryPool represents the memory pool for randao mixes trie.

View Source
var RootsMemoryPool = new(sync.Pool)

RootsMemoryPool represents the memory pool for state roots/block roots trie.

View Source
var ValidatorsMemoryPool = new(sync.Pool)

ValidatorsMemoryPool represents the memory pool for 3d byte slices.

Functions

func GetDoubleByteSlice

func GetDoubleByteSlice(size int) [][]byte

GetDoubleByteSlice retrieves the 2d byte slice of the desired size from the memory pool.

func GetRandaoMixesTrie

func GetRandaoMixesTrie(size int) [][]*[32]byte

GetRandaoMixesTrie retrieves the 3d byte slice of the desired size from the memory pool.

func GetRootsTrie

func GetRootsTrie(size int) [][]*[32]byte

GetRootsTrie retrieves the 3d byte trie of the desired size from the memory pool.

func GetValidatorsTrie

func GetValidatorsTrie(size int) [][]*[32]byte

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL