Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3900088c
Commit
3900088c
authored
Jun 06, 2008
by
Travis E. Oliphant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove locking from buffer protocol as-per discussion.
parent
b2750b5d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
36 deletions
+0
-36
Include/object.h
Include/object.h
+0
-11
Modules/_bsddb.c
Modules/_bsddb.c
+0
-6
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes.c
+0
-5
Modules/arraymodule.c
Modules/arraymodule.c
+0
-5
Objects/abstract.c
Objects/abstract.c
+0
-6
Objects/memoryobject.c
Objects/memoryobject.c
+0
-3
No files found.
Include/object.h
View file @
3900088c
...
...
@@ -163,7 +163,6 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#define PyBUF_WRITABLE 0x0001
/* we used to include an E, backwards compatible alias */
#define PyBUF_WRITEABLE PyBUF_WRITABLE
#define PyBUF_LOCK 0x0002
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
...
...
@@ -174,25 +173,15 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
#define PyBUF_CONTIG_RO (PyBUF_ND)
#define PyBUF_CONTIG_LCK (PyBUF_ND | PyBUF_LOCK)
#define PyBUF_CONTIG_XLCK (PyBUF_ND | PyBUF_LOCK | PyBUF_WRITABLE)
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
#define PyBUF_STRIDED_LCK (PyBUF_STRIDES | PyBUF_LOCK)
#define PyBUF_STRIDED_XLCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_WRITABLE)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
#define PyBUF_RECORDS_LCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_FORMAT)
#define PyBUF_RECORDS_XLCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_WRITABLE \
| PyBUF_FORMAT)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
#define PyBUF_FULL_LCK (PyBUF_INDIRECT | PyBUF_LOCK | PyBUF_FORMAT)
#define PyBUF_FULL_XLCK (PyBUF_INDIRECT | PyBUF_LOCK | PyBUF_WRITABLE \
| PyBUF_FORMAT)
#define PyBUF_READ 0x100
...
...
Modules/_bsddb.c
View file @
3900088c
...
...
@@ -312,12 +312,6 @@ static Py_buffer * _malloc_view(PyObject *obj)
"Py_buffer malloc failed"
);
return
NULL
;
}
/* We use PyBUF_LOCK to prevent other threads from trashing the data
buffer while we release the GIL. http://bugs.python.org/issue1035 */
if
(
PyObject_GetBuffer
(
obj
,
view
,
PyBUF_LOCK
)
==
-
1
)
{
PyMem_Free
(
view
);
return
NULL
;
}
if
(
view
->
ndim
>
1
)
{
PyErr_SetString
(
PyExc_BufferError
,
"buffers must be single dimension"
);
...
...
Modules/_ctypes/_ctypes.c
View file @
3900088c
...
...
@@ -2449,11 +2449,6 @@ static int CData_GetBuffer(PyObject *_self, Py_buffer *view, int flags)
Py_ssize_t
i
;
if
(
view
==
NULL
)
return
0
;
if
(((
flags
&
PyBUF_LOCK
)
==
PyBUF_LOCK
))
{
PyErr_SetString
(
PyExc_BufferError
,
"Cannot lock this object."
);
return
-
1
;
}
view
->
buf
=
self
->
b_ptr
;
view
->
len
=
self
->
b_size
;
...
...
Modules/arraymodule.c
View file @
3900088c
...
...
@@ -1779,11 +1779,6 @@ static const void *emptybuf = "";
static
int
array_buffer_getbuf
(
arrayobject
*
self
,
Py_buffer
*
view
,
int
flags
)
{
if
((
flags
&
PyBUF_LOCK
))
{
PyErr_SetString
(
PyExc_BufferError
,
"Cannot lock data"
);
return
-
1
;
}
if
(
view
==
NULL
)
goto
finish
;
view
->
buf
=
(
void
*
)
self
->
ob_item
;
...
...
Objects/abstract.c
View file @
3900088c
...
...
@@ -672,12 +672,6 @@ PyBuffer_FillInfo(Py_buffer *view, void *buf, Py_ssize_t len,
int
readonly
,
int
flags
)
{
if
(
view
==
NULL
)
return
0
;
if
(((
flags
&
PyBUF_LOCK
)
==
PyBUF_LOCK
)
&&
readonly
!=
0
)
{
PyErr_SetString
(
PyExc_BufferError
,
"Cannot lock this object."
);
return
-
1
;
}
if
(((
flags
&
PyBUF_WRITABLE
)
==
PyBUF_WRITABLE
)
&&
(
readonly
==
1
))
{
PyErr_SetString
(
PyExc_BufferError
,
...
...
Objects/memoryobject.c
View file @
3900088c
...
...
@@ -230,9 +230,6 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
case
PyBUF_WRITE
:
flags
=
PyBUF_FULL
;
break
;
case
PyBUF_SHADOW
:
flags
=
PyBUF_FULL_XLCK
;
break
;
}
if
(
PyObject_GetBuffer
(
obj
,
view
,
flags
)
!=
0
)
{
...
...
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