forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alloc_test.go
25 lines (23 loc) · 923 Bytes
/
alloc_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package gno
import (
"testing"
"unsafe"
)
func TestAllocSizes(t *testing.T) {
// go elemental
println("_allocPointer", unsafe.Sizeof(&StructValue{}))
println("_allocSlice", unsafe.Sizeof([]byte("12345678901234567890123456789012345678901234567890")))
// gno types
println("PointerValue{}", unsafe.Sizeof(PointerValue{}))
println("StructValue{}", unsafe.Sizeof(StructValue{}))
println("ArrayValue{}", unsafe.Sizeof(ArrayValue{}))
println("SliceValue{}", unsafe.Sizeof(SliceValue{}))
println("FuncValue{}", unsafe.Sizeof(FuncValue{}))
println("MapValue{}", unsafe.Sizeof(MapValue{}))
println("BoundMethodValue{}", unsafe.Sizeof(BoundMethodValue{}))
println("Block{}", unsafe.Sizeof(Block{}))
println("NativeValue{}", unsafe.Sizeof(NativeValue{}))
println("TypeValue{}", unsafe.Sizeof(TypeValue{}))
println("TypedValue{}", unsafe.Sizeof(TypedValue{}))
println("ObjectInfo{}", unsafe.Sizeof(ObjectInfo{}))
}