Handle MemoryError for list and strings.#1779
Handle MemoryError for list and strings.#1779philippeitis wants to merge 4 commits intoRustPython:mainfrom
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. |
auvipy
left a comment
There was a problem hiding this comment.
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.