Author: Armin Rigo <[email protected]>
Branch: cffi-new-allocator
Changeset: r78449:70f788fd9dca
Date: 2015-07-06 11:06 +0200
http://bitbucket.org/pypy/pypy/changeset/70f788fd9dca/
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
@@ -38,7 +38,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
@@ -112,18 +112,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,13 +265,12 @@
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]
def test_ffi_new_allocator_1(self):
import _cffi_backend as _cffi1_backend
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit