FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Include/cpython/memoryobject.h at 3.14 · python/cpython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.3k
Star
74.9k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Include
/
cpython
/
memoryobject.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (42 loc) · 2.17 KB
Breadcrumbs
cpython
/
Include
/
cpython
/
memoryobject.h
Copy path
File metadata and controls
50 lines (42 loc) · 2.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef
Py_CPYTHON_MEMORYOBJECT_H
# error
"this header file must not be included directly"
#endif
/* The structs are declared here so that macros can work, but they shouldn't
be considered public. Don't access their fields directly, use the macros
and functions instead! */
#define
_Py_MANAGED_BUFFER_RELEASED
0x001
/* access to exporter blocked */
#define
_Py_MANAGED_BUFFER_FREE_FORMAT
0x002
/* free format */
typedef
struct
{
PyObject_HEAD
int
flags
;
/* state flags */
Py_ssize_t
exports
;
/* number of direct memoryview exports */
Py_buffer
master
;
/* snapshot buffer obtained from the original exporter */
}
_PyManagedBufferObject
;
/* memoryview state flags */
#define
_Py_MEMORYVIEW_RELEASED
0x001
/* access to master buffer blocked */
#define
_Py_MEMORYVIEW_C
0x002
/* C-contiguous layout */
#define
_Py_MEMORYVIEW_FORTRAN
0x004
/* Fortran contiguous layout */
#define
_Py_MEMORYVIEW_SCALAR
0x008
/* scalar: ndim = 0 */
#define
_Py_MEMORYVIEW_PIL
0x010
/* PIL-style layout */
#define
_Py_MEMORYVIEW_RESTRICTED
0x020
/* Disallow new references to the memoryview's buffer */
typedef
struct
{
PyObject_VAR_HEAD
_PyManagedBufferObject
*
mbuf
;
/* managed buffer */
Py_hash_t
hash
;
/* hash value for read-only views */
int
flags
;
/* state flags */
Py_ssize_t
exports
;
/* number of buffer re-exports */
Py_buffer
view
;
/* private copy of the exporter's view */
PyObject
*
weakreflist
;
Py_ssize_t
ob_array
[
1
];
/* shape, strides, suboffsets */
}
PyMemoryViewObject
;
#define
_PyMemoryView_CAST
(
op
) _Py_CAST(PyMemoryViewObject*, op)
/* Get a pointer to the memoryview's private copy of the exporter's buffer. */
static
inline
Py_buffer
*
PyMemoryView_GET_BUFFER
(
PyObject
*
op
) {
return
(
&
_PyMemoryView_CAST
(
op
)
->
view
);
}
#define
PyMemoryView_GET_BUFFER
(
op
) PyMemoryView_GET_BUFFER(_PyObject_CAST(op))
/* Get a pointer to the exporting object (this may be NULL!). */
static
inline
PyObject
*
PyMemoryView_GET_BASE
(
PyObject
*
op
) {
return
_PyMemoryView_CAST
(
op
)
->
view
.
obj
;
}
#define
PyMemoryView_GET_BASE
(
op
) PyMemoryView_GET_BASE(_PyObject_CAST(op))
Back
|
FazBrowse Home
|
New Git URL