MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / borrow_key

Function borrow_key

src/borrow/shared.rs:383–394  ·  view source on GitHub ↗
(py: Python<'py>, array: *mut PyArrayObject)

Source from the content-addressed store, hash-verified

381}
382
383fn borrow_key<'py>(py: Python<'py>, array: *mut PyArrayObject) -> BorrowKey {
384 let range = data_range(py, array);
385
386 let data_ptr = unsafe { (*array).data };
387 let gcd_strides = gcd_strides(array);
388
389 BorrowKey {
390 range,
391 data_ptr,
392 gcd_strides,
393 }
394}
395
396fn data_range<'py>(py: Python<'py>, array: *mut PyArrayObject) -> (*mut c_char, *mut c_char) {
397 let nd = unsafe { (*array).nd } as usize;

Callers 7

acquire_sharedFunction · 0.85
acquire_mut_sharedFunction · 0.85
release_sharedFunction · 0.85
release_mut_sharedFunction · 0.85
borrow_multiple_arraysFunction · 0.85
borrow_multiple_viewsFunction · 0.85

Calls 2

data_rangeFunction · 0.85
gcd_stridesFunction · 0.85

Tested by 3

borrow_multiple_arraysFunction · 0.68
borrow_multiple_viewsFunction · 0.68