mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 17:56:02 +00:00
Add empty recarray test, check for calloc fail
This commit is contained in:
@@ -116,6 +116,8 @@ public:
|
||||
auto buf_info = info;
|
||||
if (!buf_info.ptr)
|
||||
buf_info.ptr = std::calloc(info.size, info.itemsize);
|
||||
if (!buf_info.ptr)
|
||||
pybind11_fail("NumPy: failed to allocate memory for buffer");
|
||||
auto view = py::memoryview(buf_info);
|
||||
|
||||
API& api = lookup_api();
|
||||
|
||||
Reference in New Issue
Block a user