On Mon, Dec 17, 2012 at 3:46 PM, Armin Rigo <ar...@tunes.org> wrote: > Hi Fijal, > > On Fri, Dec 14, 2012 at 9:04 PM, Maciej Fijalkowski <fij...@gmail.com> wrote: >> That said, I agree that exposing a different C API is not solving >> much, while adding burden to maintainers of both Cython and PyPy and >> I'm generally against the idea. > > I tend to agree with this point (so I disagree with what Leonardo said > just now, on this front :-). > > (skipped explanation...) > >> What we get: >> >> * Simple refcounting (can be implemented in C as macros even) >> >> * Lack of dictionaries > > It sounds like a good model to me. If I'm right, refcounting is even > simpler than in CPython, because all it needs is to increment or > decrement the refcount, but not check for zero. This check is done > only during collection. > > About "Lack of dictionaries", it's unclear: as a first approximation > to your idea, we could simply keep a dictionary going from the PyPy > object to the C object. (We don't need the opposite direction.)
If you have a dictionary, then the pypy object does not keep the cpy object alive (or the dictionary keeps both of them alive or some other stuff). Maybe we can something like what we do now with hashes of objects. Dictionary while in nursery and then add the link if it survives? _______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev