Hi,
I am working on a small odin/raylib program as a way to learn and I am getting a warning I don’t understand. Specifically, the warning is about a potential stack overflow when trying to create a SOA with “component” arrays bigger than ~256 KB. The warning persists after trying a few different memory allocation techniques to see if I could ensure the SOAwasn’t stack allocated (eg. arena allocator >1 MB in size) . The code below shows a minimal recreation that creates the warning.
package main
import "core:fmt"
vec3 :: [3]f32
n :: 32 * 1024
test :: struct {
x: vec3,
}
main :: proc() {
example_soa:= new(#soa[n]test)
fmt.println(size_of(example_soa^))
}
When I increase the array size further, the exe crashes on launch (full code, not the above). Possibly the stack overflowing?
Is a SOA always stack allocated? Any help in resolving the stack overflow or insight into the issue would be greatly appreciated! Thanks very much.