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

opSlice can be @trusted on an immutable Vector? #29

Open
John-Colvin opened this issue Jun 24, 2019 · 2 comments
Open

opSlice can be @trusted on an immutable Vector? #29

John-Colvin opened this issue Jun 24, 2019 · 2 comments

Comments

@John-Colvin
Copy link

not a Vector of immutable elements mind you - but a totally immutable vector.

@John-Colvin John-Colvin changed the title opSlice can be @trusted on an immutable Vector opSlice can be @trusted on an immutable Vector? Jun 24, 2019
@John-Colvin
Copy link
Author

Hmm. As soon as wrote this I doubted myself.

The two things that get in the way are reallocation and deallocation. The former is clearly not allowed on an immutable Vector, but the latter?

@atilaneves
Copy link
Owner

Hmmm. It's possible that the slice outlives the vector and is now pointing to dangling memory. In any case I have to completely review all uses of @trusted in automem. It's not going to be pretty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants