Skip to content

Commit d17eb0c

Browse files
committed
added way to disable memory alloc
1 parent 8ad546e commit d17eb0c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ pub fn prepare_array_for_axis<'py>(
406406
array: PyReadonlyArray2<'py, bool>,
407407
axis: isize,
408408
) -> PyResult<PreparedBool2D<'py>> {
409+
410+
// let shape = array.shape();
411+
// let slice = array.as_slice().unwrap();
412+
// return Ok(PreparedBool2D {
413+
// data: unsafe { std::mem::transmute(slice) }, // &[bool] → &[u8]
414+
// nrows: shape[0],
415+
// ncols: shape[1],
416+
// _keepalive: None,
417+
// });
418+
409419
if axis != 0 && axis != 1 {
410420
return Err(PyValueError::new_err("axis must be 0 or 1"));
411421
}

0 commit comments

Comments
 (0)