Skip to content
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

Zero-sized array cannot be read from npy on Windows #88

Open
zhihaoy opened this issue Oct 7, 2020 · 0 comments
Open

Zero-sized array cannot be read from npy on Windows #88

zhihaoy opened this issue Oct 7, 2020 · 0 comments

Comments

@zhihaoy
Copy link
Contributor

zhihaoy commented Oct 7, 2020

xtensor uses allocator to allocate xarray, but unlike new T[N] which does not return nullptr if N == 0, std::allocator<char>{}.allocate(m_n_bytes) may return nullptr. When it happens in MSVC STL runtime, the following code

    if (m_buffer == nullptr)
    {
        XTENSOR_THROW(std::runtime_error, "This npy_file has already been cast.");
    }

will deem a zero-sized array from npy file not exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant