-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Disallow size zero memory #53903
Comments
Not currently, as it is depended on in quite a few places |
which places? The only ones I can think of at the moment are they are constructed by empty arrays and Dicts. Changing those to allocate ones with a minimal capacity would allow us to remove the boundscheck in memoryrefget/set and the caching of size 0 memories. Is there additional problems we would incur that I'm missing? |
ah, is the problem that we use |
From a user POV, I like being able to have zero-sized memory. Not allowing it would be an strange inconsistency (similar to say, not allowing zero-sized strings), and it also happens to make a useful placeholder value which can be more practical than a Nothing. |
EDIT: never mind. I didn't check this on 1.11 so didn't see that it's already a thing. Thanks for (ahem) pointing this out. |
@mikmoore good news for you:
|
possibly too late, but would the design have been simpler if we just disallowed 0 length memory? since it's not resizable, there isn't much need to be able to make one.
Originally posted by @oscardssmith in #53896 (comment)
The text was updated successfully, but these errors were encountered: