Getting references to objects without incrementing reference counters

Artur Siekielski artur.siekielski at gmail.com
Mon Nov 15 12:30:16 EST 2010


On Nov 15, 5:28 pm, Jean-Paul Calderone <calderone.jeanp... at gmail.com>
wrote:
> On Nov 15, 10:42 am, de... at web.de (Diez B. Roggisch) wrote:
>
> > And circumvene a great deal of the dynamic features in python
> > (which you don't need for this usecase, but still are there)
>
> Great as the features might be, when you don't need them, it's clearly
> a bad thing to have them drag you down.  Fortunately the PyPy team is
> making great progress in implementing a runtime that transparently
> sheds
> those dynamic features when running a program that doesn't take
> advantage
> of them.

In case of PyPy such design - forks() + relying on copy-on-write - I
think will not work at all, because PyPy GC moves objects so they will
not stay in the same memory pages. Or if they are not modified they
will stay at the same memory address?

CPython's simple runtime (no real GC) makes reasoning about memory-
level structures easy, so I was hoping that copy-on-write will work
here. Anyway for my usecase using unsafe_listget (implemented by me -
doesn't increment reference count) does the job.



More information about the Python-list mailing list