Make any use typeid rather than ^Type_Info

This commit is contained in:
gingerBill
2018-05-12 18:40:49 +01:00
parent 830f4f540f
commit 2ef22e86e0
8 changed files with 135 additions and 101 deletions
+3 -1
View File
@@ -43,7 +43,9 @@ ptr_to_bytes :: proc "contextless" (ptr: ^$T, len := 1) -> []byte {
}
any_to_bytes :: proc "contextless" (val: any) -> []byte {
return transmute([]byte)raw.Slice{val.data, val.type_info.size};
ti := type_info_from_typeid(val.typeid);
size := ti != nil ? ti.size : 0;
return transmute([]byte)raw.Slice{val.data, size};
}