mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 00:44:27 +00:00
3d12322103
* add mem pool * use mem pool * Update shared/memorypool/memorypool.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update shared/memorypool/memorypool.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
17 lines
372 B
Go
17 lines
372 B
Go
package memorypool
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestRoundTripMemoryRetrieval(t *testing.T) {
|
|
byteSlice := make([][]byte, 1000)
|
|
PutDoubleByteSlice(byteSlice)
|
|
newSlice := GetDoubleByteSlice(1000)
|
|
|
|
if len(newSlice) != 1000 {
|
|
t.Errorf("Wanted same slice object, but got different object. "+
|
|
"Wanted slice with length %d but got length %d", 1000, len(newSlice))
|
|
}
|
|
}
|