gh-137928: remove redundant size validation in multiprocessing.heap (GH-137929)
remove redundant size check, malloc does it --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
committed by
GitHub
parent
0e88be6f55
commit
df6676549c
@@ -324,10 +324,6 @@ class BufferWrapper(object):
|
||||
_heap = Heap()
|
||||
|
||||
def __init__(self, size):
|
||||
if size < 0:
|
||||
raise ValueError("Size {0:n} out of range".format(size))
|
||||
if sys.maxsize <= size:
|
||||
raise OverflowError("Size {0:n} too large".format(size))
|
||||
block = BufferWrapper._heap.malloc(size)
|
||||
self._state = (block, size)
|
||||
util.Finalize(self, BufferWrapper._heap.free, args=(block,))
|
||||
|
||||
Reference in New Issue
Block a user