Stream: cranelift

Topic: Heap?


view this post on Zulip Robin Lindner (Aug 07 2022 at 12:18):

I need to define Strings / Byte Arrays.
How can I allocate these on heap and get a reference to it?

view this post on Zulip Afonso Bordado (Aug 07 2022 at 13:06):

Cranelift doesen't have those types natively.

However you allocate the memory in rust and pass a pointer as a i64 and do a load on it

view this post on Zulip Afonso Bordado (Aug 07 2022 at 13:06):

We do have a heap mechanism, but that is mostly to try to sandbox heap accesses, if you don't need that, I think (I may be wrong here) you can ignore it.

view this post on Zulip Afonso Bordado (Aug 07 2022 at 13:07):

If you need to allocate memory from clif, you can link malloc or some other memory allocating function and call that.


Last updated: Oct 23 2024 at 20:03 UTC