Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
c541223a
Commit
c541223a
authored
Oct 26, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manually mangle new names used in memoryview code to prevent them from interfering with user C code
parent
b8eb6545
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+13
-13
No files found.
Cython/Utility/MemoryView.pyx
View file @
c541223a
...
@@ -305,8 +305,8 @@ cdef void *align_pointer(void *memory, size_t alignment) nogil:
...
@@ -305,8 +305,8 @@ cdef void *align_pointer(void *memory, size_t alignment) nogil:
## note that this could be implemented in a more beautiful way in "normal" Cython,
## note that this could be implemented in a more beautiful way in "normal" Cython,
## but this code gets merged into the user module and not everything works there.
## but this code gets merged into the user module and not everything works there.
DEF
THREAD_LOCKS_PREALLOCATED
=
8
DEF
THREAD_LOCKS_PREALLOCATED
=
8
cdef
int
_thread_locks_used
=
0
cdef
int
_
_pyx_memoryview_
thread_locks_used
=
0
cdef
PyThread_type_lock
[
THREAD_LOCKS_PREALLOCATED
]
_thread_locks
=
[
cdef
PyThread_type_lock
[
THREAD_LOCKS_PREALLOCATED
]
_
_pyx_memoryview_
thread_locks
=
[
PyThread_allocate_lock
(),
PyThread_allocate_lock
(),
PyThread_allocate_lock
(),
PyThread_allocate_lock
(),
PyThread_allocate_lock
(),
PyThread_allocate_lock
(),
...
@@ -343,10 +343,10 @@ cdef class memoryview(object):
...
@@ -343,10 +343,10 @@ cdef class memoryview(object):
(
<
__pyx_buffer
*>
&
self
.
view
).
obj
=
Py_None
(
<
__pyx_buffer
*>
&
self
.
view
).
obj
=
Py_None
Py_INCREF
(
Py_None
)
Py_INCREF
(
Py_None
)
global
_thread_locks_used
global
_
_pyx_memoryview_
thread_locks_used
if
_thread_locks_used
<
THREAD_LOCKS_PREALLOCATED
:
if
_
_pyx_memoryview_
thread_locks_used
<
THREAD_LOCKS_PREALLOCATED
:
self
.
lock
=
_
thread_locks
[
_thread_locks_used
]
self
.
lock
=
_
_pyx_memoryview_thread_locks
[
__pyx_memoryview
_thread_locks_used
]
_thread_locks_used
+=
1
_
_pyx_memoryview_
thread_locks_used
+=
1
if
self
.
lock
is
NULL
:
if
self
.
lock
is
NULL
:
self
.
lock
=
PyThread_allocate_lock
()
self
.
lock
=
PyThread_allocate_lock
()
if
self
.
lock
is
NULL
:
if
self
.
lock
is
NULL
:
...
@@ -366,14 +366,14 @@ cdef class memoryview(object):
...
@@ -366,14 +366,14 @@ cdef class memoryview(object):
__Pyx_ReleaseBuffer
(
&
self
.
view
)
__Pyx_ReleaseBuffer
(
&
self
.
view
)
cdef
int
i
cdef
int
i
global
_thread_locks_used
global
_
_pyx_memoryview_
thread_locks_used
if
self
.
lock
!=
NULL
:
if
self
.
lock
!=
NULL
:
for
i
in
range
(
_thread_locks_used
):
for
i
in
range
(
_
_pyx_memoryview_
thread_locks_used
):
if
_thread_locks
[
i
]
is
self
.
lock
:
if
_
_pyx_memoryview_
thread_locks
[
i
]
is
self
.
lock
:
_thread_locks_used
-=
1
_
_pyx_memoryview_
thread_locks_used
-=
1
if
i
!=
_thread_locks_used
:
if
i
!=
_
_pyx_memoryview_
thread_locks_used
:
_
thread_locks
[
i
],
_thread_locks
[
_thread_locks_used
]
=
(
_
_pyx_memoryview_thread_locks
[
i
],
__pyx_memoryview_thread_locks
[
__pyx_memoryview
_thread_locks_used
]
=
(
_
thread_locks
[
_thread_locks_used
],
_thread_locks
[
i
])
_
_pyx_memoryview_thread_locks
[
__pyx_memoryview_thread_locks_used
],
__pyx_memoryview
_thread_locks
[
i
])
break
break
else
:
else
:
PyThread_free_lock
(
self
.
lock
)
PyThread_free_lock
(
self
.
lock
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment