- 01 Feb, 2013 1 commit
-
-
Yury V. Zaytsev authored
-
- 30 Jan, 2013 2 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
remove warning about missing 'const' support from docs and fix advice on declaring macros as 'enum' (which works only for ints)
-
- 29 Jan, 2013 1 commit
-
-
Stefan Behnel authored
-
- 28 Jan, 2013 8 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
scoder authored
Fix overflow_check CompileError with msvc
-
- 27 Jan, 2013 11 commits
-
-
Christoph Gohlke authored
--HG-- extra : transplant_source : %3FH%B6t%1FFL%D8%2BF%7CV%7D%10T9%EA%CB%A0%00
-
Christoph Gohlke authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
enable control flow analysis for stack allocated structured variables (struct, union, array, C++ class)
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
- 26 Jan, 2013 15 commits
-
-
Stefan Behnel authored
rewrite except-as semantics using try-finally - seems to be the easiest way to get flow control analysis working for all cases
-
Stefan Behnel authored
-
scoder authored
Add test for memoryview of extension type
-
Stefan Behnel authored
-
scoder authored
Fix calling an "except +" cpp function in a nogil function
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
--HG-- extra : transplant_source : %8A%F1%17%5C%A7%CA%1C%B1%17%A1%C5t%06O%5BI%F2%19Vq
-
Stefan Behnel authored
-
- 25 Jan, 2013 1 commit
-
-
Matěj Laitl authored
For a source: |cdef extern from "<foo>": | cdef void foo_cpp() nogil except + | |cdef call_foo() nogil: | foo_cpp() We used to generate something like this to actually call foo_cpp() in call_foo(): |try{foo_cpp();} |catch(...) { | Py_BLOCK_THREADS; __Pyx_CppExn2PyErr(); Py_UNBLOCK_THREADS | `code.error_goto(self.pos))` |} where Py_BLOCK_THREADS expands to "PyEval_RestoreThread(_save);". __Pyx_CppExn2PyErr() (and alternatives, see SimpleCallNode) calls CPython A API methods so it needs to be guarded in a nogil environment. One problem is that "PyThreadState *_save" is only declared by "with nogil:" block, so a .cpp file that doesn't compile is generated for the above code. However, I think the real issue is that Py_(UN)BLOCK_THREADS is inappropriate here, as it isn't allowed to be called recursively and is valid only directly in a Py_BEGIN_ALLOW_THREADS ... Py_END_ALLOW_THREADS. IMO PyGILState_Ensure() and PyGILState_Release() (through `code.put_ensure_gil()` and a friend) is the correct thing to call here as it is allowed to be called recursively and actually ensures the current thread can call CPython C API. This patch does exactly this (and it breaks the generated code to multiple lines as it would be way too long otherwise), plus it extends the cpp_exceptions_nogil.pyx test with above example that doesn't compile with this fix not applied. Note that we explicitly pass declare_gilstate=True to put_ensure_gil(), as PyGILState_Ensure() docs state that recursive calls to it must not share the PyGILState_STATE. C++-style declaring a variable inside a block should be no-problem here, as try{} .. catch() is obviously valid only in a C++ code. --HG-- extra : transplant_source : %AA%F3%BDk%FE%F9%01%7F%8C%A4n%5E%DA4%97%A5%D9%AF%D60
-
- 26 Jan, 2013 1 commit
-
-
Stefan Behnel authored
-