mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-20 00:16:47 +00:00
Add #soa pointer type to aid with refactoring to #soa data types
a: #soa[16]Foo p := &a[6] #assert(type_of(p) == #soa^#soa[16]Foo) p^.x = 123 p.x = 123
This commit is contained in:
@@ -176,6 +176,9 @@ Type_Info_Matrix :: struct {
|
||||
column_count: int,
|
||||
// Total element count = column_count * elem_stride
|
||||
}
|
||||
Type_Info_Soa_Pointer :: struct {
|
||||
elem: ^Type_Info,
|
||||
}
|
||||
|
||||
Type_Info_Flag :: enum u8 {
|
||||
Comparable = 0,
|
||||
@@ -217,6 +220,7 @@ Type_Info :: struct {
|
||||
Type_Info_Relative_Pointer,
|
||||
Type_Info_Relative_Slice,
|
||||
Type_Info_Matrix,
|
||||
Type_Info_Soa_Pointer,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -403,6 +407,12 @@ Raw_Cstring :: struct {
|
||||
data: [^]byte,
|
||||
}
|
||||
|
||||
Raw_Soa_Pointer :: struct {
|
||||
data: rawptr,
|
||||
index: int,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// Defined internally by the compiler
|
||||
|
||||
@@ -228,6 +228,9 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
case Type_Info_Multi_Pointer:
|
||||
print_string("[^]")
|
||||
print_type(info.elem)
|
||||
case Type_Info_Soa_Pointer:
|
||||
print_string("#soa ^")
|
||||
print_type(info.elem)
|
||||
case Type_Info_Procedure:
|
||||
print_string("proc")
|
||||
if info.params == nil {
|
||||
|
||||
Reference in New Issue
Block a user