-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
should error on resize of foreign-buffer arrays #3430
Comments
I personally like the idea of a separate |
To clarify, the intent of this issue is just to give an error for |
The amount of trouble caused by being able to resize arrays often makes me wonder if it's worth it. |
Well, it causes trouble because it's so powerful. There is a decent chance we should have a dequeue type of some sort instead, and the ability to make an Array from one without copying. |
Yeah, that's kind of what I was thinking. It seems to me that it's uncommon to both need to build an array incrementally and need it to have contiguous layout. You generally build things incrementally when you just want to compile a list of things. One thought is that cell arrays could be a distinct type from |
Growable byte arrays are clearly necessary at least. |
Right now we allow buffers which Julia did not allocate itself to be resized by allocating a new buffer and copying the data over.
Instead @JeffBezanson and I came to the conclusion that it would be a good idea to disallow any kind of operation that could change the memory in which the array is allocated (mostly resize). This would also allow us to expose an
Array
API as well as having a convenienceMmmapArray
API for mmaped Arrays, where the former would essentially only allow get/set.The text was updated successfully, but these errors were encountered: