Skip to content

Commit aea08d3

Browse files
author
Jeff Yanta
committed
Reintroduce GetPageSizeFromMemoryLayout
1 parent b90f9f2 commit aea08d3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/solana/cvm/types_memory_layout.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ func getMemoryLayout(src []byte, dst *MemoryLayout, offset *int) {
1717
*dst = MemoryLayout(src[*offset])
1818
*offset += 1
1919
}
20+
21+
func GetPageSizeFromMemoryLayout(layout MemoryLayout) uint32 {
22+
switch layout {
23+
case MemoryLayoutNonce:
24+
return GetVirtualAccountSizeInMemory(VirtualAccountTypeDurableNonce)
25+
case MemoryLayoutTimelock:
26+
return GetVirtualAccountSizeInMemory(VirtualAccountTypeTimelock)
27+
case MemoryLayoutRelay:
28+
return GetVirtualAccountSizeInMemory(VirtualAccountTypeRelay)
29+
}
30+
return 0
31+
}

0 commit comments

Comments
 (0)