-
I've been trying to publish a small game written in Odin + SDL2 to the web via wasm. It took me a while, but through scrounging around other emscripten examples on the internet, I've managed to put this together: But when I've tried adding any dynamic allocation to the project, it crashes in different ways.
Any ideas what's going on here? I've seen many others do odin + wasm projects, so I'm sure it's something I'm doing wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Allocating the struct doesn't fail on its own, but setting any of its fields like this does. I certainly don't see how a Stack overflow is possible there... I think it might just be a side-effect of the illegal access. In other variants, I have previously seen complaints about accessing a 0 field. |
Beta Was this translation helpful? Give feedback.
-
Freestanding targets do not have any allocator set up for you, I am guessing you aren't setting one which makes all allocations just return nil and probably crash because of it. |
Beta Was this translation helpful? Give feedback.
Freestanding targets do not have any allocator set up for you, I am guessing you aren't setting one which makes all allocations just return nil and probably crash because of it.