Message161776
| Author |
sbt |
| Recipients |
pitrou, sbt, skrah |
| Date |
2012年05月28日.12:50:02 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338209403.75.0.837880370451.issue14930@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> In the test, you should call gc.collect() so that it works on non-
> reference counted implementations.
I did think about using gc.collect(), but I was not sure whether it was guaranteed to collect everything possible if you only call it only once. (I know nothing about garbage collectors.)
> Also, I would call PyObject_ClearWeakRefs() after memory_release() and
> Py_CLEAR(self->mbuf), not before (in case a weakref callback relies on
> the buffer being released).
Doing it after Py_CLEAR(self->mbuf) seems to contradict
http://docs.python.org/dev/extending/newtypes.html?highlight=pyobject_clearweakrefs#weak-reference-support
which says
The only further addition is that the destructor needs to call the weak
reference manager to clear any weak references. This should be done *before*
any other parts of the destruction have occurred, but is only required if the
weak reference list is non-NULL: |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年05月28日 12:50:03 | sbt | set | recipients:
+ sbt, pitrou, skrah |
| 2012年05月28日 12:50:03 | sbt | set | messageid: <1338209403.75.0.837880370451.issue14930@psf.upfronthosting.co.za> |
| 2012年05月28日 12:50:03 | sbt | link | issue14930 messages |
| 2012年05月28日 12:50:02 | sbt | create |
|