Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 20296:6cc0b48049ec legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 07 Oct 2001 03:54:51 +0000 |
| parents | 426b379a138b |
| children | 7b41f7a2e528 |
line wrap: on
line diff
--- a/Objects/typeobject.c Sun Oct 07 03:12:08 2001 +0000 +++ b/Objects/typeobject.c Sun Oct 07 03:54:51 2001 +0000 @@ -191,9 +191,7 @@ 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);
