def METHOD_NAME(maskrange):
	masklen = (maskrange.stop - maskrange.start) // granule // 32 * 4 + 4
	mask_base = u.heap.malloc(masklen)
	lp.sweep(maskrange.start, maskrange.stop, mask_base)
	mask = iface.readmem(mask_base, masklen)
	u.heap.free(mask_base)
	return np.frombuffer(mask, dtype=np.uint8)