MCPcopy Index your code
hub / github.com/python/cpython / allocate_bytes

Function allocate_bytes

Lib/test/test_tracemalloc.py:41–46  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

39 return tuple(frames)
40
41def allocate_bytes(size):
42 nframe = tracemalloc.get_traceback_limit()
43 bytes_len = (size - EMPTY_STRING_SIZE)
44 frames = get_frames(nframe, 1)
45 data = b'x' * bytes_len
46 return data, tracemalloc.Traceback(frames, min(len(frames), nframe))
47
48def create_snapshots():
49 traceback_limit = 2

Callers 11

test_get_tracesMethod · 0.85
allocate_bytes2Method · 0.85
test_clear_tracesMethod · 0.85
test_reset_peakMethod · 0.85
test_snapshotMethod · 0.85
fork_childMethod · 0.85
setUpMethod · 0.85

Calls 1

get_framesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…