#-

1 messages · Page 1 of 1 (latest)

thorn plume
#

Each time a new page is allocated the previous memory buffer in JS is invalidated.

#

With regard to the memory layout, the beginning is actually the stack. So writing your string at offset 0 is writing directly to the shadow stack and could be overwritten.

#

Stack size by default is 1MB, from there on further is where Zig puts its memory. You can override this stack size.

#

Can't safely rely on it at all

#

You don't know where in the stack data is being written

#

The same way as you previously obtained it

#

No

#

All you have to do, is re-read memory.buffer

#

wasm_allocator is a fast non-thread-safe allocator. page_allocator will literally allocate a new page on each allocation.

#

So whichever suits your needs

#

The GeneralPurposeAllocator is fine too

#

It's backed by the page_allocator, but uses buckets to track allocations and doesn't allocate an entire new page unless needed

#

You're welcome!