Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent potential data loss in numpy's dtype::get_itemsize().
The numpy 2.0 migration guide states [https://numpy.org/devdocs/numpy_2_0_migration_guide.html]: "PyDataType_ELSIZE and PyDataType_SET_ELSIZE (note that the result is now npy_intp and not int)." Even though it is rather unlikely to have have elements larger than 2GB each, prevent potential numerical overflows, which could occur when casting ssize_t to int on 64-bit systems.
- Loading branch information