Skip to content

Commit

Permalink
Handle EINVAL in allocate_aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
ttsesm authored Jul 2, 2020
1 parent 802b5f4 commit cfb916f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion embree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit cfb916f

Please sign in to comment.