Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r2180:325525b02433 Date: 2015-06-09 13:53 +0200 http://bitbucket.org/cffi/cffi/changeset/325525b02433/
Log: Don't need an integer, actually, just object() is fine diff --git a/cffi/gc_weakref.py b/cffi/gc_weakref.py --- a/cffi/gc_weakref.py +++ b/cffi/gc_weakref.py @@ -5,7 +5,6 @@ def __init__(self, ffi): self.ffi = ffi self.data = {} - self.nextindex = 0 def build(self, cdata, destructor): # make a new cdata of the same type as the original one @@ -18,7 +17,6 @@ destructor(cdata) # key = ref(new_cdata, remove) - index = self.nextindex - self.nextindex = index + 1 # we're protected by the lock here + index = object() self.data[index] = key return new_cdata _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit