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

Method _new_arena

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

Source from the content-addressed store, hash-verified

156 return (n + mask) & ~mask
157
158 def _new_arena(self, size):
159 # Create a new arena with at least the given *size*
160 length = self._roundup(max(self._size, size), mmap.PAGESIZE)
161 # We carve larger and larger arenas, for efficiency, until we
162 # reach a large-ish size (roughly L3 cache-sized)
163 if self._size < self._DOUBLE_ARENA_SIZE_UNTIL:
164 self._size *= 2
165 util.info('allocating a new mmap of length %d', length)
166 arena = Arena(length)
167 self._arenas.append(arena)
168 return (arena, 0, length)
169
170 def _discard_arena(self, arena):
171 # Possibly delete the given (unused) arena

Callers 1

_mallocMethod · 0.95

Calls 4

_roundupMethod · 0.95
ArenaClass · 0.85
infoMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected