-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Handle MemoryError for list and strings. #1779
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
base: main
Are you sure you want to change the base?
Conversation
be2a41b
to
d6fbc42
Compare
d6fbc42
to
822badd
Compare
074ee28
to
1f9eae6
Compare
I'm not sure if this is the correct approach; |
That is true, but this is also a reasonable sanity check, since a list with 8 byte pointers can only contain up to usize::MAX / 8 elements. Beyond that, allocating becomes the virtual machine's problem and will need to dealt with accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be great if you could rebase it for further review.
This aims to address #1750 by raising a Memory error for excessively large allocations. It adds a MAX_MEMORY_SIZE const to VM which is then used by objlist.rs and objstr.rs when doing imul or mul operations.