Home | History | Annotate | Download | only in multiprocessing

Lines Matching refs:block

114         # returns a large enough block -- it might be much larger
126 block = seq.pop()
130 (arena, start, stop) = block
133 return block
135 def _free(self, block):
137 (arena, start, stop) = block
153 block = (arena, start, stop)
157 self._len_to_seq[length].append(block)
159 self._len_to_seq[length] = [block]
162 self._start_to_block[(arena, start)] = block
163 self._stop_to_block[(arena, stop)] = block
165 def _absorb(self, block):
166 # deregister this block so it can be merged with a neighbour
167 (arena, start, stop) = block
173 seq.remove(block)
184 block = self._pending_free_blocks.pop()
187 self._allocated_blocks.remove(block)
188 self._free(block)
190 def free(self, block):
191 # free a block returned by malloc()
196 # immediately, the block is added to a list of blocks to be freed
202 # can't acquire the lock right now, add the block to the list of
204 self._pending_free_blocks.append(block)
209 self._allocated_blocks.remove(block)
210 self._free(block)
215 # return a block of right size (possibly rounded up)
227 block = (arena, start, new_stop)
228 self._allocated_blocks.add(block)
229 return block
243 block = BufferWrapper._heap.malloc(size)
244 self._state = (block, size)
245 Finalize(self, BufferWrapper._heap.free, args=(block,))