[rust-dev] How to allocate record on memory?
a.stavonin at gmail.com
Tue Apr 17 19:24:18 PDT 2012
I need unmanaged, C-compatibe structure on heap which will not be
autodeleted in any cases.
I don't *really* understand what you are trying to do, but I think you
> have two choices:
> (1) A call to libc::malloc, like you showed in your later mail.
> (2) Allocate the type as a @T and then use ptr::addr_of(*x) to get an
> unsafe ptr from that. Then you are responsible for keeping a live
> reference to the @T so that we don't collect it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev