Skip to content

Commit 2684611

Browse files
author
Matthias Köppe
authored
Merge pull request #8 from tornaria/missing-noexcept
Add missing noexcept clauses
2 parents 346745c + 47b1c64 commit 2684611

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

memory_allocator/memory.pxd

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,35 @@ cdef extern from *:
3535
int unlikely(int) nogil # Defined by Cython
3636

3737

38-
cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil:
38+
cdef inline void* sig_malloc "sig_malloc"(size_t n) noexcept nogil:
3939
sig_block()
4040
cdef void* ret = malloc(n)
4141
sig_unblock()
4242
return ret
4343

4444

45-
cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil:
45+
cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) noexcept nogil:
4646
sig_block()
4747
cdef void* ret = realloc(ptr, size)
4848
sig_unblock()
4949
return ret
5050

5151

52-
cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil:
52+
cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) noexcept nogil:
5353
sig_block()
5454
cdef void* ret = calloc(nmemb, size)
5555
sig_unblock()
5656
return ret
5757

5858

59-
cdef inline void sig_free "sig_free"(void* ptr) nogil:
59+
cdef inline void sig_free "sig_free"(void* ptr) noexcept nogil:
6060
sig_block()
6161
free(ptr)
6262
sig_unblock()
6363

6464

6565
@cython.cdivision(True)
66-
cdef inline size_t mul_overflowcheck(size_t a, size_t b) nogil:
66+
cdef inline size_t mul_overflowcheck(size_t a, size_t b) noexcept nogil:
6767
"""
6868
Return a*b, checking for overflow. Assume that a > 0.
6969
If overflow occurs, return <size_t>(-1).

memory_allocator/memory_allocator.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cdef extern from *:
66
int unlikely(int) nogil # defined by Cython
77

88

9-
cdef inline void* align(void* ptr, size_t alignment):
9+
cdef inline void* align(void* ptr, size_t alignment) noexcept:
1010
"""
1111
Round up ``ptr`` to the nearest multiple of ``alignment``, which
1212
must be a power of 2

memory_allocator/signals.pxd

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Usage of ``sig_block`` / ``sig_unblock`` is not necesarry for ``MemoryAllocator``:
44
# One should not wrap its methods with ``sig_on`` ... ``sig_off`` anyway.
55

6-
cdef inline void sig_block() nogil:
6+
cdef inline void sig_block() noexcept nogil:
77
pass
88

9-
cdef inline void sig_unblock() nogil:
9+
cdef inline void sig_unblock() noexcept nogil:
1010
pass

0 commit comments

Comments
 (0)