diff options
author | Armin Rigo <arigo@tunes.org> | 2015-07-06 11:07:40 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-07-06 11:07:40 +0200 |
commit | e86e8333400570f2f9b6656ccca6f0812724c1b4 (patch) | |
tree | 37935f9640a8d7a3d919eb8a8c7e1e1aaa91c577 /c | |
parent | d68e08758d37b7d8aeb3478946c6f27ca479464a (diff) | |
download | cffi-e86e8333400570f2f9b6656ccca6f0812724c1b4.tar.gz |
Found a simpler way to implement the in-line ffi.gc() on top of the
out-of-line one
Diffstat (limited to 'c')
-rw-r--r-- | c/_cffi_backend.c | 4 | ||||
-rw-r--r-- | c/ffi_obj.c | 13 |
2 files changed, 0 insertions, 17 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 066235d..f32bbc2 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -5554,9 +5554,6 @@ static PyObject *b__get_types(PyObject *self, PyObject *noarg) (PyObject *)&CTypeDescr_Type); } -/* forward: implemented in ffi_obj.c */ -static PyObject *b_gcp(PyObject *self, PyObject *args); - /************************************************************/ static char _testfunc0(char a, char b) @@ -5862,7 +5859,6 @@ static PyMethodDef FFIBackendMethods[] = { {"newp_handle", b_newp_handle, METH_VARARGS}, {"from_handle", b_from_handle, METH_O}, {"from_buffer", b_from_buffer, METH_VARARGS}, - {"gcp", b_gcp, METH_VARARGS}, #ifdef MS_WIN32 {"getwinerror", (PyCFunction)b_getwinerror, METH_VARARGS | METH_KEYWORDS}, #endif diff --git a/c/ffi_obj.c b/c/ffi_obj.c index 3899289..c1d9d98 100644 --- a/c/ffi_obj.c +++ b/c/ffi_obj.c @@ -680,19 +680,6 @@ static PyObject *ffi_gc(FFIObject *self, PyObject *args, PyObject *kwds) return gc_weakrefs_build(self, cd, destructor); } -static PyObject *b_gcp(PyObject *self, PyObject *args) -{ - /* for in-line mode */ - static FFIObject *ffi1 = NULL; - - if (ffi1 == NULL) { - ffi1 = ffi_internal_new(&FFI_Type, NULL); - if (ffi1 == NULL) - return NULL; - } - return ffi_gc(ffi1, args, NULL); -} - PyDoc_STRVAR(ffi_callback_doc, "Return a callback object or a decorator making such a callback object.\n" "'cdecl' must name a C function pointer type. The callback invokes the\n" |