7 ms·
> but you can also call malloc/free within an unsafe block. Very cool. I was afraid I would be forced into an FFI type scenario (which Rust apparently has good
by ci5er 10y ago
> but you can also call malloc/free within an unsafe block.
Very cool. I was afraid I would be forced into an FFI type scenario (which Rust apparently has good support for anyway).
Thanks!
- steveklabnik 10y agoNo problem. To elaborate on _this_ slightly, today in stable Rust you can call libc's malloc/free directly. There's also the Rust alloc::heap module, but it's not yet stable, and so is only available on nightly Rust https://doc.rust-lang.org/alloc/heap/index.html https://doc.rust-lang.org/alloc/heap/index.html
- ci5er 10y agoCool. I didn't even find either of those on the roadmap a bit over year ago when I looked at it -- outside some speculative chat on forums/lists/tickets. It seems as if I need to give it a couple more months and give it a look-see again.