diff --git a/embree.pyx b/embree.pyx index 2318b36..a26f551 100644 --- a/embree.pyx +++ b/embree.pyx @@ -16,7 +16,9 @@ IF UNAME_SYSNAME == "Windows": cdef void *allocate_aligned(size_t size, size_t alignment): errno = 0 cdef void *mem = _aligned_malloc(size, alignment) - if errno == ENOMEM: + if errno == EINVAL: + raise Exception('bad alignment') + elif errno == ENOMEM: raise Exception('failed to allocate') elif errno != 0: raise Exception('unhandled error')