I'm in the process of getting a project of mine targeting WASM, and it appears that the stack size in the browser is relatively small and non-configurable. A consequence of this is that my application will overflow the stack while attempting to allocate
a large struct on the heap, due to the intermediate stack allocation when calling Box::new()
. The unstable box
syntax fixed this, but it appears to be dead in the water.
I managed to get it running without box
, albeit in a less-than-ideal fashion. I had to refactor my structs to hold reference to boxed data in order to allocate in smaller chunks.
Is there a way to allocate directly to the heap without box
?