Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from esmf-org/esmpy_support_large_arrays
ESMPy: Fix type cast to support large Arrays In a few places, the size of an Array was being cast to a c_int. This caused an overflow if the size exceeded 32 bits. An example of the issue is reported here, and I have reproduced this: https://github.com/orgs/esmf-org/discussions/263 From some reading, I think the correct cast here should be to ssize_t, which resolves to a long int (64 bits) on a 64-bit architecture. I am not 100% positive of this, but this seems consistent with what I have found; e.g., see: Argument list in the PyMemoryView_FromMemory function: https://docs.python.org/3/c-api/memoryview.html https://docs.python.org/3/c-api/intro.html#c.Py_ssize_t https://stackoverflow.com/questions/20987390/cython-why-when-is-it-preferable-to-use-py-ssize-t-for-indexing
- Loading branch information