summaryrefslogtreecommitdiff
path: root/tests/memoryview/memoryview_no_withgil_check.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/memoryview/memoryview_no_withgil_check.pyx')
-rw-r--r--tests/memoryview/memoryview_no_withgil_check.pyx11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/memoryview/memoryview_no_withgil_check.pyx b/tests/memoryview/memoryview_no_withgil_check.pyx
new file mode 100644
index 000000000..4753bab12
--- /dev/null
+++ b/tests/memoryview/memoryview_no_withgil_check.pyx
@@ -0,0 +1,11 @@
+# mode: compile
+
+# cython: test_fail_if_c_code_has = __Pyx_ErrOccurredWithGIL
+
+# cython-generated memoryview code shouldn't resort to
+# __Pyx_ErrOccurredWithGIL for error checking (because it's inefficient
+# inside a nogil block)
+
+def assign(double[:] a, double[:] b):
+ with nogil:
+ a[:] = b[:]