Charles G Waldman wrote: > Can you explain why you made this (seemingly arbitrary) change? > > I think that since "self" was created via: > > self = PyObject_NEW_VAR(PatternObject, &Pattern_Type, n); > > which calls PyObjectINIT, which in turn calls _Py_NewReference, which > increments _Py_RefTotal, it is incorrect to simply do a PyObject_DEL > to de-allocate it -- won't this screw up the value of _Py_RefTotal? and what do you think will happen if you call the destructor before you've initialized all pointer fields in the object? (according to the docs, the NEW/New functions return uninitialized memory. in this case, we're bailing out before the object has been fully initialized. pattern_dealloc definitely isn't prepared to deal with random pointer values...) > Admittedly this is a minor nit and only matters if Py_TRACE_REFS is > defined - I just wanted to check to make sure my understanding of > reference counting w.r.t. memory allocation and deallocation is > correct - if the above is in error, I'd apprecate any corrections... same here. I don't doubt it's working as you say it does, but I find it strange that you shouldn't be able to DEL an object you just created with NEW... maybe DEL should be fixed? Cheers /F
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4