<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 12:30 PM Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019, 04:04 Victor Stinner <<a href="mailto:vstinner@redhat.com" target="_blank">vstinner@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le mar. 9 avr. 2019 à 22:16, Steve Dower <<a href="mailto:steve.dower@python.org" rel="noreferrer" target="_blank">steve.dower@python.org</a>> a écrit :<br>
> What are the other changes that would be required?<br>
<br>
I don't know.<br>
<br>
> And is there another<br>
> way to get the same functionality without ABI modifications?<br>
<br>
Py_TRACE_REFS is a double linked list of *all* Python objects. To get<br>
this functionality, you need to store the list somewhere. I don't know<br>
how to maintain such list outside the PyObject structure.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I assume these pointers get updated from some generic allocation/free code. Could that code instead overallocate by 16 bytes, use the first 16 bytes to hold the pointers, and then return the PyObject* as (actual allocated pointer + 16)? Basically the "container_of" trick.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I don't think that I ever used sys.getobjects(), whereas many projects<br>
use gc.get_objects() which is also available in release builds (not<br>
only in debug builds).</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Can anyone explain what pydebug builds are... for? Confession: I've never used them myself, and don't know why I would want to.</div></div></blockquote><div><br></div><div>There is a bunch of extra things done in a debug build, e.g. all freed memory is blanked out with a known pattern so it's easy to tell when you're reading from freed memory (and thus probably messed up your refcounts). And then various extras are tossed on to the sys module to help with things. Basically anything people have found useful and require being compiled in typically get clumped in under the debug build.</div><div><br></div><div>-Brett<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">(I have to assume that most of Steve's Windows downloads are from folks who thought they were downloading a python debugger.)</div><div dir="auto"><br></div><div dir="auto">-n</div><div dir="auto"></div></div>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br>
</blockquote></div></div>