The PEP 445, C API for malloc, allows to plug multiple wrappers and each wrapper has its own "void* context" data. When you register a new wrapper, you store the current context and function to later chain it.
See the hooks example: https://www.python.org/dev/peps/pep-0445/#use-case-3-setup-hooks-on-memory-block-allocators Since the PEP 523 also adds a function, would it be possible to somehow design a mecanism to "chain wrappers"? I know that the PEP 523 has a different design, so maybe it's not possible. For example, the context can be passed to PyFrameEvalFunction. In this case, each project would have to register its own eval function, including vmprof. I don't know if it makes sense for vmprof to modify the behaviour at runtime (add a C frame per Python eval frame). Victor
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com