unneeded isinstance(size, int) in alloc [pr] (#8189)

This commit is contained in:
chenyu
2024-12-12 13:05:02 -05:00
committed by GitHub
parent 72ff631f8d
commit 2fe98e44cd

View File

@@ -143,7 +143,7 @@ class Buffer:
class Allocator:
# overriden in LRUAllocator
def alloc(self, size:int, options:Optional[BufferSpec]=None):
assert not isinstance(size, int) or size > 0, f"alloc size must be positve, getting {size}"
assert size > 0, f"alloc size must be positve, getting {size}"
return self._alloc(size, options if options is not None else BufferSpec())
def free(self, opaque, size:int, options:Optional[BufferSpec]=None): self._free(opaque, options if options is not None else BufferSpec())