0

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?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
w.brian
  • 16,296
  • 14
  • 69
  • 118

0 Answers0