MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / get_snapshot

Function get_snapshot

tests/test_memory.py:273–281  ·  view source on GitHub ↗

Wrapper for tracemalloc.take_snapshot() that filters out blocks with backtraces that we are not interested in.

()

Source from the content-addressed store, hash-verified

271 ]
272
273 def get_snapshot():
274 '''
275 Wrapper for tracemalloc.take_snapshot() that filters out blocks with
276 backtraces that we are not interested in.
277 '''
278 ret = tracemalloc.take_snapshot()
279 ret2 = ret.filter_traces(tm_filters)
280 #log(f' {len(ret.traces)=} => {len(ret2.traces)=}')
281 return ret2
282
283 # Check that `analysis()` does not leak.
284 #

Callers 1

_test_4751Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…