-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal to add equivalent of the Vec
type
#1077
Comments
How would this be represented in the ABI and coded? From the impl at #1118: struct RawVec<T> {
ptr: u64,
cap: u64,
}
pub struct Vec<T> {
buf: RawVec,
len: u64,
} This would be coded like |
Do we plan to send heap oriented data across the FFI? This will be very tricky, fairly brittle IMO, easy to get wrong, other than for raw pointers to individual heap allocations. |
I have to send data from the heap in my Multicall script which was the reason for |
Yes, we plan to support heap types across the ABI. The SDKs will have to be smart enough to know about particular heap types and set their pointers correctly. The data can be somewhere in |
When writing Sway code I have been finding myself wanting the
Vec
type, it would be awesome if we had it 😄Dependent on this issue (#428) and on dynamic size arrays
Rust's implemenation of
Vec
: https://doc.rust-lang.org/std/vec/struct.Vec.htmlThe text was updated successfully, but these errors were encountered: