From cfb916f9c56c6df2c7a5fe66b13c2f179cfb954b Mon Sep 17 00:00:00 2001 From: ttsesm <10189018+ttsesm@users.noreply.github.com> Date: Thu, 2 Jul 2020 13:43:19 +0200 Subject: [PATCH] Handle EINVAL in allocate_aligned --- embree.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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')