Skip to content

Commit 46d7318

Browse files
committed
ffi: add PyArray_{malloc,realloc,free} re-exports
1 parent ab2d214 commit 46d7318

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/npyffi/array.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,12 @@ pub unsafe fn PyArray_CheckExact(op: *mut PyObject) -> c_int {
394394
(ffi::Py_TYPE(op) == PY_ARRAY_API.get_type_object(NpyTypes::PyArray_Type)) as _
395395
}
396396

397+
// these are under `#if NPY_USE_PYMEM == 1` which seems to be always defined as 1
398+
pub use pyo3::ffi::{
399+
PyMem_RawFree as PyArray_free, PyMem_RawMalloc as PyArray_malloc,
400+
PyMem_RawRealloc as PyArray_realloc,
401+
};
402+
397403
#[cfg(test)]
398404
mod tests {
399405
use super::PY_ARRAY_API;

0 commit comments

Comments
 (0)