[Python-Dev] stackable ints [stupid idea (ignore) :v]

Tim Peters tim_one at email.msn.com
Sat Jun 12 23:37:14 CEST 1999


[Aaron Watters]
> ...
> Another fix would be to put the refcount in the static side with
> no speed penalty
>
>      (typedescr
>       repr* ----------------------> data
>       refcount
>      )
>
>   but would that be wasteful of space?

The killer is for types where repr* is a real pointer:

    x = [Whatever()]
    y = x[:]

Now we have two physically distinct descriptors pointing at the same thing,
and so also two distinct refcounts for that thing -- impossible to keep them
in synch efficiently; "del y" has no way efficient way to find the refcount
hiding in x.

tbings-and-and-their-refcounts-are-monogamous-ly y'rs  - tim






More information about the Python-Dev mailing list