Release done for pip reasons.
Release done for pip reasons.
CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default. This flag is not added if you run the compilation with CPython 3.4, as it only works with CPython >= 3.5, but by now this version of Python is quite old (and we no longer distribute cffi wheels for it).
This may require that you upgrade virtualenv (requires version 16 or newer) or at least copy manually python3.dll into your existing virtualenvs. For distributing wheels with your cffi modules, you may also need to upgrade wheel to the just-released version 0.35.
You can manually disable Py_LIMITED_API by calling ffi.set_source(..., py_limited_api=False).
ffi.dlopen() can now be called with a handle (as a void *) to an already-opened C library.
CPython only: fixed a stack overflow issue for calls like lib.myfunc([large list]). If the function is declared as taking a float * argument, for example, then the array is temporarily converted into a C array of floats—however, the code used to use alloca() for this temporary storage, no matter how large. This is now fixed.
The fix concerns all modes: in-line/out-of-line API/ABI. Also note that your API-mode C extension modules need to be regenerated with cffi 1.14 in order to get the fix; i.e. for API mode, the fix is in the generated C sources. (The C sources generated from cffi 1.14 should also work when running in a different environment in which we have an older version of cffi. Also, this change makes no difference on PyPy.)
As a workaround that works on all versions of cffi, you can write lib.myfunc(ffi.new("float[]", [large list])), which is equivalent but explicity builds the intermediate array as a regular Python object on the heap.
fixed a memory leak inside ffi.getwinerror() on CPython 3.x.
CPython 3 on Windows: we again no longer compile with Py_LIMITED_API by default because such modules still cannot be used with virtualenv. The problem is that it doesn’t work in CPython <= 3.4, and for technical reason we can’t enable this flag automatically based on the version of Python.
Like before, Issue #350 mentions a workaround if you still want the Py_LIMITED_API flag and either you are not concerned about virtualenv or you are sure your module will not be used on CPython <= 3.4: pass define_macros=[("Py_LIMITED_API", None)] as a keyword to the ffibuilder.set_source() call.
(only released inside PyPy 5.8.0)
Nothing changed from v1.4.1.
Nothing changed from v1.2.0.