Commit fc09a6dc authored by Stefan Behnel's avatar Stefan Behnel

Mark the last deletion of a memory view slice as "unlikely()" to ask the C...

Mark the last deletion of a memory view slice as "unlikely()" to ask the C compiler to optimise for the repeated re-use case (usually in loops).
parent 8bcd2387
...@@ -523,7 +523,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW({{memviewslice_name}} *memslice, ...@@ -523,7 +523,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW({{memviewslice_name}} *memslice,
last_time = __pyx_sub_acquisition_count(memview) == 1; last_time = __pyx_sub_acquisition_count(memview) == 1;
memslice->data = NULL; memslice->data = NULL;
if (last_time) {
if (unlikely(last_time)) {
if (have_gil) { if (have_gil) {
Py_CLEAR(memslice->memview); Py_CLEAR(memslice->memview);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment