#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
#define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)),Py_SIZE(op))
+#ifdef Py_BUILD_CORE
+# define _PyTuple_ITEMS(op) ((((PyTupleObject *)(op))->ob_item))
+#endif
+
/* Macro, *only* to be used to fill in brand new tuples */
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
#endif
stack = args;
}
else if (nargs == 0) {
- stack = &PyTuple_GET_ITEM(pto->args, 0);
+ stack = _PyTuple_ITEMS(pto->args);
}
else {
if (nargs2 <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) {
/* use borrowed references */
memcpy(stack,
- &PyTuple_GET_ITEM(pto->args, 0),
+ _PyTuple_ITEMS(pto->args),
pto_nargs * sizeof(PyObject*));
memcpy(&stack[pto_nargs],
args,
if (pto->use_fastcall) {
res = partial_fastcall(pto,
- &PyTuple_GET_ITEM(args, 0),
+ _PyTuple_ITEMS(args),
PyTuple_GET_SIZE(args),
kwargs2);
}
*nargs = 0;
}
else if (PyTuple_Check(args)) {
- *stack = &PyTuple_GET_ITEM(args, 0);
+ *stack = ((PyTupleObject *)args)->ob_item;
*nargs = PyTuple_GET_SIZE(args);
}
else {
if (PyFunction_Check(callable)) {
return _PyFunction_FastCallDict(callable,
- &PyTuple_GET_ITEM(args, 0),
+ _PyTuple_ITEMS(args),
PyTuple_GET_SIZE(args),
kwargs);
}
&& co->co_argcount == PyTuple_GET_SIZE(argdefs)) {
/* function called with no arguments, but all parameters have
a default value: use default values as arguments .*/
- args = &PyTuple_GET_ITEM(argdefs, 0);
+ args = _PyTuple_ITEMS(argdefs);
return function_code_fastcall(co, args, PyTuple_GET_SIZE(argdefs),
globals);
}
return NULL;
}
- k = &PyTuple_GET_ITEM(kwtuple, 0);
+ k = _PyTuple_ITEMS(kwtuple);
pos = i = 0;
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
/* We must hold strong references because keyword arguments can be
qualname = ((PyFunctionObject *)func) -> func_qualname;
if (argdefs != NULL) {
- d = &PyTuple_GET_ITEM(argdefs, 0);
+ d = _PyTuple_ITEMS(argdefs);
nd = PyTuple_GET_SIZE(argdefs);
}
else {
&& co->co_argcount == PyTuple_GET_SIZE(argdefs)) {
/* function called with no arguments, but all parameters have
a default value: use default values as arguments .*/
- stack = &PyTuple_GET_ITEM(argdefs, 0);
+ stack = _PyTuple_ITEMS(argdefs);
return function_code_fastcall(co, stack, PyTuple_GET_SIZE(argdefs),
globals);
}
qualname = ((PyFunctionObject *)func) -> func_qualname;
if (argdefs != NULL) {
- d = &PyTuple_GET_ITEM(argdefs, 0);
+ d = _PyTuple_ITEMS(argdefs);
nd = PyTuple_GET_SIZE(argdefs);
}
else {
}
return _PyEval_EvalCodeWithName((PyObject*)co, globals, (PyObject *)NULL,
stack, nargs,
- nkwargs ? &PyTuple_GET_ITEM(kwnames, 0) : NULL,
+ nkwargs ? _PyTuple_ITEMS(kwnames) : NULL,
stack + nargs,
nkwargs, 1,
d, (int)nd, kwdefs,
}
else {
return _PyCFunction_FastCallDict(func,
- &PyTuple_GET_ITEM(args, 0),
+ _PyTuple_ITEMS(args),
PyTuple_GET_SIZE(args),
kwargs);
}
/* use borrowed references */
stack[0] = obj;
memcpy(&stack[1],
- &PyTuple_GET_ITEM(args, 0),
- argcount * sizeof(PyObject *));
+ _PyTuple_ITEMS(args),
+ argcount * sizeof(PyObject *));
result = _PyObject_FastCallDict(callable,
stack, argcount + 1,
func(*(arg1, arg2, arg3)): func(arg1, arg2, arg3) */
PyObject *args = stack[0];
result = _PyObject_FastCall(callable,
- &PyTuple_GET_ITEM(args, 0),
+ _PyTuple_ITEMS(args),
PyTuple_GET_SIZE(args));
}
else {
if (v == NULL || !PyUnicode_CheckExact(v)) {
Py_FatalError("non-string found in code slot");
}
- PyUnicode_InternInPlace(&PyTuple_GET_ITEM(tuple, i));
+ PyUnicode_InternInPlace(&_PyTuple_ITEMS(tuple)[i]);
}
}
}
result = _PyMethodDef_RawFastCallDict(descr->d_method, self,
- &PyTuple_GET_ITEM(args, 1), nargs - 1,
+ &_PyTuple_ITEMS(args)[1], nargs - 1,
kwargs);
result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
return result;
}
result = _PyMethodDef_RawFastCallDict(descr->d_method, self,
- &PyTuple_GET_ITEM(args, 1), argc - 1,
+ &_PyTuple_ITEMS(args)[1], argc - 1,
kwds);
result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
return result;
PyObject **stack;
Py_ssize_t nargs;
- stack = &PyTuple_GET_ITEM(args, 0);
+ stack = _PyTuple_ITEMS(args);
nargs = PyTuple_GET_SIZE(args);
return _PyFunction_FastCallDict(func, stack, nargs, kwargs);
}
}
C_TRACE(result, _PyCFunction_FastCallDict(func,
- &PyTuple_GET_ITEM(callargs, 1),
+ &_PyTuple_ITEMS(callargs)[1],
nargs - 1,
kwdict));
Py_DECREF(func);
return 0;
}
- stack = &PyTuple_GET_ITEM(args, 0);
+ stack = _PyTuple_ITEMS(args);
nargs = PyTuple_GET_SIZE(args);
}
else {
return 0;
}
- stack = &PyTuple_GET_ITEM(args, 0);
+ stack = _PyTuple_ITEMS(args);
nargs = PyTuple_GET_SIZE(args);
return vgetargskeywordsfast_impl(stack, nargs, keywords, NULL,
parser, p_va, flags);
"PyArg_UnpackTuple() argument list is not a tuple");
return 0;
}
- stack = &PyTuple_GET_ITEM(args, 0);
+ stack = _PyTuple_ITEMS(args);
nargs = PyTuple_GET_SIZE(args);
#ifdef HAVE_STDARG_PROTOTYPES