Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add a way to trace PyRefTracer_DESTROY events in tracemalloc #130695

Closed
@tom-pytel

Description

@tom-pytel

Feature or enhancement

Proposal:

This suggestion arose from there not currently being a way in python to test for PyRefTracer_DESTROY events (that I could find), specifically from there not being a way to add a regression test for: #130382

Add some simple code to tracemalloc to count PyRefTracer_CREATE and PyRefTracer_DESTROY events.

tracemalloc.start()
tracemalloc.clear_traces()

i = []
del i

refs = tracemalloc.get_traced_refs()

print(refs)  # will print (1, 1)

tracemalloc.stop()

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions