push_struct.core

This commit is contained in:
Krzosa Karol
2023-03-28 22:11:16 +02:00
parent 9f8023ac5c
commit 0804a76f7e

15
examples/push_struct.core Normal file
View File

@@ -0,0 +1,15 @@
#import "Arena.core"
// @todo:
// Add new special type #Type_Size
PushStruct :: (a: *Arena, type: Type /*#Type_Size*/): *void
ti := GetTypeInfo(type)
result := PushSize(a, ti.size->Base.SizeU)
return result
main :: (argc: int, argv: **char): int
arena: Arena
a: *int = PushStruct(&arena, int)
return 0