Stream: wasmtime

Topic: ✔ Custom allocator for Fibers


view this post on Zulip Tyler Rockwood (Oct 09 2023 at 14:15):

Hello - I have noticed that FiberStack uses mmap to allocate memory, in general the application I'm embedding wasmtime in allocates most of the system memory upfront for various reasons. Would there be any opposition to a custom allocator for these stacks?

view this post on Zulip Tyler Rockwood (Oct 09 2023 at 14:19):

Although it looks like windows does something...different. I've never had the privilege to work on windows, but it looks like the async_stack_size config option is ignored on windows anyways, so presumably it'd be fine if this API was unused on windows too?

view this post on Zulip Alex Crichton (Oct 09 2023 at 14:36):

I think that'd be reasonable, yeah, and yes it's ok to basically ignore windows for fibers because we are required to use certain APIs on Windows for fibers with no alternatives, so mmap and customization can only be applied on non-windows

view this post on Zulip Tyler Rockwood (Oct 09 2023 at 14:39):

Cool - have any thoughts on an API? Otherwise I can take a stab at this and point a proposal here (or should I open an issue for this?)

view this post on Zulip Alex Crichton (Oct 09 2023 at 14:51):

Feel free to give it a stab and/or open an issue! I've not thought about this myself, but it'd probably look similar-ish to the MemoryCreator type

view this post on Zulip Notification Bot (Oct 09 2023 at 17:00):

Tyler Rockwood has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC