ANN.: Beta 1.0 of Weak Reference Extension Module is nowavailable

shindich at my-deja.com shindich at my-deja.com
Sun Nov 19 21:33:23 CET 2000


In article <8v83rj01fou at news1.newsguy.com>,
  "Alex Martelli" <aleaxit at yahoo.com> wrote:
> "Karsten Schneider" <k at felinity.com> wrote in message
> news:3A176E0F.39BF350B at felinity.com...
>     [snip]
> > However, I have a question about the implementation. The way I
understand
> it,
> > it hooks into Python's [de-]allocation mechanism to make sure weak
> references
> > don't point to objects that no longer exist. Does this require a
search
> > through all the weak references for each deallocation? If so, that
sounds
> > like a new performance problem.
>
> No!  Only objects that are subject to weak-referencing get their
> deallocation-function hooked; there is no overhead for all other
> deallocations.
>
> Alex
>
>
Alex is absolutely correct. Only those objects that are being weak
referenced will be checked. On top of that, the check is a lookup in the
STL's map, which is a log(n).

Regards,

AlexS


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list