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

Method __init__

Lib/multiprocessing/heap.py:38–51  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

36 _rand = tempfile._RandomNameSequence()
37
38 def __init__(self, size):
39 self.size = size
40 for i in range(100):
41 name = 'pym-%d-%s' % (os.getpid(), next(self._rand))
42 buf = mmap.mmap(-1, size, tagname=name)
43 if _winapi.GetLastError() == 0:
44 break
45 # We have reopened a preexisting mmap.
46 buf.close()
47 else:
48 raise FileExistsError('Cannot find name for new mmap')
49 self.name = name
50 self.buffer = buf
51 self._state = (self.size, self.name)
52
53 def __getstate__(self):
54 assert_spawning(self)

Callers

nothing calls this directly

Calls 3

_choose_dirMethod · 0.95
closeMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected