Skip to content

Commit 835cf73

Browse files
committed
clean cython-lint warnings + some typos
1 parent 815e5b1 commit 835cf73

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It provides a single extension class `MemoryAllocator` with `cdef` methods
77

88
- `malloc`,
99
- `calloc`,
10-
- `alloarray`,
10+
- `allocarray`,
1111
- `realloc`,
1212
- `reallocarray`,
1313
- `aligned_malloc`,

Diff for: memory_allocator/memory.pxd

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# Copied from https://github.com/sagemath/cysignals/blob/master/src/cysignals/memory.pxd.
2-
# Note that this is no longer interruption safe, as we efficiently remove ``sig_block``/``sig_unblock``.
1+
# Copied from
2+
# https://github.com/sagemath/cysignals/blob/master/src/cysignals/memory.pxd
3+
4+
# Note that this is no longer interruption safe,
5+
# as we efficiently remove ``sig_block``/``sig_unblock``.
36
"""
47
Memory allocation functions which are interrupt-safe
58
@@ -8,7 +11,7 @@ functions. The ``check_`` variants check the return value and raise
811
``MemoryError`` in case of failure.
912
"""
1013

11-
#*****************************************************************************
14+
# ****************************************************************************
1215
# Copyright (C) 2011-2016 Jeroen Demeyer <[email protected]>
1316
#
1417
# cysignals is free software: you can redistribute it and/or modify it
@@ -22,9 +25,9 @@ functions. The ``check_`` variants check the return value and raise
2225
# GNU Lesser General Public License for more details.
2326
#
2427
# You should have received a copy of the GNU Lesser General Public License
25-
# along with cysignals. If not, see <http://www.gnu.org/licenses/>.
28+
# along with cysignals. If not, see <https://www.gnu.org/licenses/>.
2629
#
27-
#*****************************************************************************
30+
# ****************************************************************************
2831

2932

3033
cimport cython

Diff for: memory_allocator/memory_allocator.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ cdef class MemoryAllocator:
5151
self.pointers[i] = self.static_pointers[i]
5252
else:
5353
# Case 2: resize pointers
54-
self.pointers = <void**>check_reallocarray(self.pointers, new_size, sizeof(void*))
54+
self.pointers = <void**>check_reallocarray(self.pointers,
55+
new_size, sizeof(void*))
5556
self.size = new_size
5657

5758
cdef void** find_pointer(self, void* ptr) except NULL:
@@ -113,7 +114,7 @@ cdef class MemoryAllocator:
113114
return val
114115

115116
cdef void* reallocarray(self, void* ptr, size_t nmemb,
116-
size_t size) except? NULL:
117+
size_t size) except? NULL:
117118
r"""
118119
Re-allocates `ptr` and automatically frees it later.
119120
"""

Diff for: memory_allocator/signals.pxd

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ``memory.pxd`` is a strict copy of the version in ``cysignals``.
22

3-
# Usage of ``sig_block`` / ``sig_unblock`` is not necesarry for ``MemoryAllocator``:
3+
# Usage of ``sig_block`` / ``sig_unblock`` is not necessary
4+
# for ``MemoryAllocator``:
45
# One should not wrap its methods with ``sig_on`` ... ``sig_off`` anyway.
56

67
cdef inline void sig_block() noexcept nogil:

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def run(self):
1919
Extension(
2020
"memory_allocator.test",
2121
sources=["memory_allocator/test.pyx"]),
22-
]
22+
]
2323

2424

2525
setup(

0 commit comments

Comments
 (0)