Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r78451:94805f64e621 Date: 2015-07-06 11:43 +0200 http://bitbucket.org/pypy/pypy/changeset/94805f64e621/
Log: Kill gcp() again diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py --- a/pypy/module/_cffi_backend/__init__.py +++ b/pypy/module/_cffi_backend/__init__.py @@ -37,7 +37,6 @@ 'from_handle': 'handle.from_handle', '_get_types': 'func._get_types', 'from_buffer': 'func.from_buffer', - 'gcp': 'func.gcp', 'string': 'func.string', 'buffer': 'cbuffer.buffer', diff --git a/pypy/module/_cffi_backend/func.py b/pypy/module/_cffi_backend/func.py --- a/pypy/module/_cffi_backend/func.py +++ b/pypy/module/_cffi_backend/func.py @@ -105,18 +105,3 @@ "raw address on PyPy", w_x) # return cdataobj.W_CDataFromBuffer(space, _cdata, w_ctype, buf, w_x) - -# ____________________________________________________________ - -class ConstantFFI: - ffi1 = None - def _cleanup_(self): - self.ffi1 = None -constant_ffi = ConstantFFI() - -@unwrap_spec(w_cdata=cdataobj.W_CData) -def gcp(space, w_cdata, w_destructor): - if constant_ffi.ffi1 is None: - from pypy.module._cffi_backend import ffi_obj - constant_ffi.ffi1 = ffi_obj.make_plain_ffi_object(space) - return constant_ffi.ffi1.descr_gc(w_cdata, w_destructor) diff --git a/pypy/module/_cffi_backend/test/test_ffi_obj.py b/pypy/module/_cffi_backend/test/test_ffi_obj.py --- a/pypy/module/_cffi_backend/test/test_ffi_obj.py +++ b/pypy/module/_cffi_backend/test/test_ffi_obj.py @@ -4,8 +4,6 @@ spaceconfig = dict(usemodules=('_cffi_backend', 'array')) def teardown_method(self, meth): - from pypy.module._cffi_backend.func import constant_ffi - constant_ffi._cleanup_() _clean_cache(self.space) def test_ffi_new(self): @@ -267,10 +265,9 @@ assert p1[0] == 123 seen.append(1) ffi.gc(p, destructor=destructor) # instantly forgotten - _cffi1_backend.gcp(p, destructor=destructor) for i in range(5): if seen: break import gc gc.collect() - assert seen == [1, 1] + assert seen == [1] _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit