On Fri, Sep 28, 2018 at 3:29 PM, Gabriele <phoenix1987 at gmail.com> wrote: > On Fri, 28 Sep 2018 at 23:12, Nathaniel Smith <njs at pobox.com> wrote: >> What information do you wish the interpreter provided, that would make your program simpler and more reliable? > > An exported global variable that points to the head of the > PyInterpreterState linked list (i.e. the return value of > PyInterpreterState_Head). This way my program could just look this up > from the dynsym section instead of scanning a dump of the bss section > in memory to find a possible candidate. Hmm, it looks like in 3.7+, _PyRuntime is marked PyAPI_DATA, which I think should make it exported from dynsym? https://github.com/python/cpython/blob/4b430e5f6954ef4b248e95bfb4087635dcdefc6d/Include/internal/pystate.h#L206 And PyInterpreterState_Head is just _PyRuntime.interpreters.head. So maybe this is already done... -n -- Nathaniel J. Smith -- https://vorpus.org
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