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:
Alejandro Cabello Jiménez
2025-11-12 01:36:43 +01:00
committed by GitHub
parent 0e88be6f55
commit df6676549c

View File

@@ -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,))