Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

add capacity to svm_byte_array #129

Closed
YaronWittenstein opened this issue May 17, 2020 · 1 comment
Closed

add capacity to svm_byte_array #129

YaronWittenstein opened this issue May 17, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@YaronWittenstein
Copy link
Contributor

YaronWittenstein commented May 17, 2020

Motivation

In case the bytes pointer of svm_byte_array points to data of a Vec,
we need in the Rust side to use Vec::from_raw_parts

This is required mainly for managing Receipts.

Since the length of a Vec might be strictly less than its capacity, it's better not to assume anything about the relation of these two fields and add explicit capacity field to the svm_byte_array.

@YaronWittenstein YaronWittenstein added the enhancement New feature or request label May 17, 2020
@YaronWittenstein
Copy link
Contributor Author

Using the new Vec#leak instead of Vec#into_raw_parts makes this issue not necessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants