[pypy-commit] cffi default: Argh.

arigo noreply at buildbot.pypy.org
Wed Oct 21 06:19:00 EDT 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2355:ad45ea3e4614
Date: 2015-10-21 11:55 +0200
http://bitbucket.org/cffi/cffi/changeset/ad45ea3e4614/

Log:	Argh.

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -3664,6 +3664,11 @@
         Py_DECREF(key);
         goto error;
     }
+    /* Haaaack for our reference count hack: gcmodule.c must not see this
+       dictionary.  The problem is that any PyDict_SetItem() notices that
+       'x' is tracked and re-tracks the unique_cache dictionary.  So here
+       we re-untrack it again... */
+    PyObject_GC_UnTrack(unique_cache);
 
     assert(x->ct_unique_key == NULL);
     x->ct_unique_key = key; /* the key will be freed in ctypedescr_dealloc() */


More information about the pypy-commit mailing list