summaryrefslogtreecommitdiff
path: root/Objects/weakrefobject.c
AgeCommit message (Collapse)AuthorLines
2004-10-31SF 1055820: weakref callback vs gc vs threadsTim Peters-1/+3
In cyclic gc, clear all weakrefs to unreachable objects before allowing any Python code (weakref callbacks or __del__ methods) to run. This is a critical bugfix, affecting all versions of Python since weakrefs were introduced.
2004-08-03Be more careful about maintaining the invariants; it was actuallyFred Drake-3/+25
possible that the callback-less flavors of the ref or proxy could have been added during GC, so we don't want to replace them.
2004-02-04Allocating a new weakref object can cause existing weakref objects forFred Drake-3/+16
the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied.
2004-02-03Fix bug in interpretation of the "callback" argument in the constructors forFred Drake-1/+5
weakref ref and proxy objects; None was not being treated as identical to NULL, though it was documented as equivalent.
2003-11-20SF bug 839548: Bug in type's GC handling causes segfaults.Tim Peters-4/+30
Also SF patch 843455. This is a critical bugfix, backported from 2.4 development. I don't intend to backport beyond 2.3 maint. The bugs this fixes have been there since weakrefs were introduced.
2003-07-14Remove proxy_print(), since that caused an inconsistency betweenFred Drake-10/+2
"print repr(proxy(a))" and "proxy(a)" at an interactive prompt. Closes SF bug #722763.
2003-06-30Fix SF 762891: "del p[key]" on proxy object raises SystemError()Raymond Hettinger-1/+5
2003-04-16- The repr() of a weakref object now shows the __name__ attribute ofGuido van Rossum-6/+15
the referenced object, if it has one. Also use %p to format pointers consistently, and use <weakproxy ...> in proxy_repr(), to match the type name.
2002-08-09Add support for the iterator protocol to weakref proxy objects.Fred Drake-38/+64
Part of fixing SF bug #591704.
2002-03-27Remove weakref free list. This has the side effect of fixing a memoryNeil Schemenauer-26/+11
management bug. Also, move some duplicated code into the new_weakref fucntion.
2001-12-19proxy_compare(): Make sure that we unwrap both objects being compared ifFred Drake-6/+13
both are proxy objects.
2001-12-10Make sure that when we invoke callback functions associated with weakFred Drake-20/+24
references, we do not allow any outstanding exceptions "leak" into the callback's execution state. This closes SF bug #478534.
2001-11-28weakref_repr(), proxy_repr(): Conversion of sprintf() toBarry Warsaw-8/+11
PyOS_snprintf() for buffer overrun avoidance.
2001-11-28Fixes for possible buffer overflows in sprintf() usages.Marc-André Lemburg-1/+1
2001-10-22Referencable is not a word, so don't use it in an error message <wink>.Jeremy Hylton-2/+2
2001-10-18Remove an unnecessary check for NULL.Fred Drake-4/+3
2001-10-18When weakref proxies are involved in binary & ternary slot operations,Fred Drake-15/+28
the left-hand operand may not be the proxy in all cases. If it isn't, we end up doing two things: a) unwrapping something that isn't a PyWeakReference (later resulting in a core dump) and b) passing a proxy as the right-hand operand anyway, even though that can't be handled by the actual handler (maybe eventually causing a core dump). This is fixed by always unwrapping all the proxies involved before passing anything to the actual handler.
2001-10-05The weak reference implementation, separated from the weakref module.Fred Drake-0/+715