diff --git a/memory_allocator/memory.pxd b/memory_allocator/memory.pxd index 12bf745..c5538b6 100644 --- a/memory_allocator/memory.pxd +++ b/memory_allocator/memory.pxd @@ -35,35 +35,35 @@ cdef extern from *: int unlikely(int) nogil # Defined by Cython -cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil: +cdef inline void* sig_malloc "sig_malloc"(size_t n) noexcept nogil: sig_block() cdef void* ret = malloc(n) sig_unblock() return ret -cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil: +cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) noexcept nogil: sig_block() cdef void* ret = realloc(ptr, size) sig_unblock() return ret -cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil: +cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) noexcept nogil: sig_block() cdef void* ret = calloc(nmemb, size) sig_unblock() return ret -cdef inline void sig_free "sig_free"(void* ptr) nogil: +cdef inline void sig_free "sig_free"(void* ptr) noexcept nogil: sig_block() free(ptr) sig_unblock() @cython.cdivision(True) -cdef inline size_t mul_overflowcheck(size_t a, size_t b) nogil: +cdef inline size_t mul_overflowcheck(size_t a, size_t b) noexcept nogil: """ Return a*b, checking for overflow. Assume that a > 0. If overflow occurs, return (-1). diff --git a/memory_allocator/memory_allocator.pxd b/memory_allocator/memory_allocator.pxd index 26d938e..846561f 100644 --- a/memory_allocator/memory_allocator.pxd +++ b/memory_allocator/memory_allocator.pxd @@ -6,7 +6,7 @@ cdef extern from *: int unlikely(int) nogil # defined by Cython -cdef inline void* align(void* ptr, size_t alignment): +cdef inline void* align(void* ptr, size_t alignment) noexcept: """ Round up ``ptr`` to the nearest multiple of ``alignment``, which must be a power of 2 diff --git a/memory_allocator/signals.pxd b/memory_allocator/signals.pxd index a7968de..f49cdd5 100644 --- a/memory_allocator/signals.pxd +++ b/memory_allocator/signals.pxd @@ -3,8 +3,8 @@ # Usage of ``sig_block`` / ``sig_unblock`` is not necesarry for ``MemoryAllocator``: # One should not wrap its methods with ``sig_on`` ... ``sig_off`` anyway. -cdef inline void sig_block() nogil: +cdef inline void sig_block() noexcept nogil: pass -cdef inline void sig_unblock() nogil: +cdef inline void sig_unblock() noexcept nogil: pass