We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dd50c6 commit 53bb400Copy full SHA for 53bb400
cymem/cymem.pyx
@@ -141,7 +141,10 @@ cdef class Pool:
141
# We need a critical section on both self and self.addresses here.
142
# See comment in alloc for rationale.
143
with cython.critical_section(self, self.addresses):
144
- self.size -= self.addresses.pop(<size_t>p)
+ # The cast to size_t below is needed so that Cython
145
+ # does not call into the C API to do the subtraction,
146
+ # which could potentially release the critical section.
147
+ self.size -= <size_t>self.addresses.pop(<size_t>p)
148
self.pyfree.free(p)
149
150
def own_pyref(self, object py_ref):
0 commit comments