Skip to content
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

struct vector should use data pointer #1439

Open
seanyoung opened this issue Jul 11, 2023 · 0 comments
Open

struct vector should use data pointer #1439

seanyoung opened this issue Jul 11, 2023 · 0 comments
Labels
enhancement New feature or request under discussion

Comments

@seanyoung
Copy link
Contributor

Some ideas:

  • Rather than having the data concatenated to struct vector, make it have a data pointer
  • The length should follow the data pointer
  • The size is not necessary. We add a function to the heap to tell us the size of the array

This would make struct vector the same as a slice on Solana system calls. The same struct for slice and vector sounds very nice.

Another idea:

  • Rather than data pointer + lengh, have a first and last pointer. Then accessing the last entry is cheaper. However, is this ever necessary in Solidity?
@seanyoung seanyoung added enhancement New feature or request under discussion labels Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request under discussion
Projects
None yet
Development

No branches or pull requests

2 participants
@seanyoung and others