Closed jepler closed 1 year ago
@jepler Looks good, many thanks!
Could you, please, add a comment in https://github.com/v923z/micropython-ulab/blob/master/docs/ulab-change-log.md, and move the version number in https://github.com/v923z/micropython-ulab/blob/6fcfeda58da8632bb7774858a9bf974afe65d5dd/code/ulab.c#L36
I don't need to see this after that, you can merge your branch.
Now, requesting to allocate an array directly from .ones() or .zeros() that is too big gives the exception 'array is too big', like numpy.
This does depend on a gcc extension,
__builtin_mul_overflow
, present since at least version 5. This extension is also supported in clang. msvc is probably the only compiler of note that does not support it.Closes: #576
There are still a few suspicious allocations of multiplied sizes elsewhere, e.g., this one from poly.c:
there are also some allocations of square arrays that are the same size as square arrays that already exist, so no overflow checking would be needed: