Skip to content

Commit 859701c

Browse files
committed
[GR-51961] Keep our C file structure closer to CPython, part 3
PullRequest: graalpython/3206
2 parents d739e23 + e2e4ced commit 859701c

File tree

15 files changed

+17492
-1448
lines changed

15 files changed

+17492
-1448
lines changed

graalpython/com.oracle.graal.python.cext/include/memoryobject.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2017 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -21,9 +21,9 @@ PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
2121

2222
#ifndef Py_LIMITED_API
2323
/* Get a pointer to the memoryview's private copy of the exporter's buffer. */
24-
#define PyMemoryView_GET_BUFFER(op) (_PyMemoryView_GetBuffer((PyObject *)(op)))
24+
#define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view)
2525
/* Get a pointer to the exporting object (this may be NULL!). */
26-
#define PyMemoryView_GET_BASE(op) (_PyMemoryView_GetBuffer((PyObject *)(op))->obj)
26+
#define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj)
2727
#endif
2828

2929
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
@@ -70,10 +70,6 @@ typedef struct {
7070
PyObject *weakreflist;
7171
Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */
7272
} PyMemoryViewObject;
73-
74-
75-
PyAPI_FUNC(Py_buffer *) _PyMemoryView_GetBuffer(PyObject *op);
76-
7773
#endif
7874

7975
#ifdef __cplusplus

0 commit comments

Comments
 (0)