Allocate a number of blocks with a given size.
(num: int, size: int)
| 123 | |
| 124 | |
| 125 | def calloc(num: int, size: int) -> AllocatedArrayPointer: |
| 126 | """Allocate a number of blocks with a given size.""" |
| 127 | address: int = c_calloc(num, size) |
| 128 | |
| 129 | if not address: |
| 130 | raise AllocationError("failed to allocate memory") |
| 131 | |
| 132 | return AllocatedArrayPointer(address, num, size, 0) |