Commit cc400539 authored by Stefan Behnel's avatar Stefan Behnel

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

Mark the first creation of a memory view slice as "unlikely()" to ask the C compiler to optimise for the repeated re-use case (usually in loops).
parent e24d2904
...@@ -494,7 +494,7 @@ __Pyx_INC_MEMVIEW({{memviewslice_name}} *memslice, int have_gil, int lineno) ...@@ -494,7 +494,7 @@ __Pyx_INC_MEMVIEW({{memviewslice_name}} *memslice, int have_gil, int lineno)
first_time = __pyx_add_acquisition_count(memview) == 0; first_time = __pyx_add_acquisition_count(memview) == 0;
if (first_time) { if (unlikely(first_time)) {
if (have_gil) { if (have_gil) {
Py_INCREF((PyObject *) memview); Py_INCREF((PyObject *) 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