mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Guido suggests, and I agree, to insist that SIZEOF_VOID_P be a power of 2.
This simplifies the rounding in _PyObject_VAR_SIZE, allows to restore the pre-rounding calling sequence, and allows some nice little simplifications in its callers. I'm still making it return a size_t, though.
This commit is contained in:
parent
0a1fc4e389
commit
f2a67daca2
4 changed files with 31 additions and 47 deletions
|
@ -191,9 +191,7 @@ PyObject *
|
|||
PyType_GenericAlloc(PyTypeObject *type, int nitems)
|
||||
{
|
||||
PyObject *obj;
|
||||
size_t size;
|
||||
|
||||
_PyObject_VAR_SIZE(size, type, nitems);
|
||||
const size_t size = _PyObject_VAR_SIZE(type, nitems);
|
||||
|
||||
if (PyType_IS_GC(type))
|
||||
obj = _PyObject_GC_Malloc(type, nitems);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue