From: Martin v. Löwis Date: Mon, 17 Nov 2008 16:22:11 +0000 (+0000) Subject: Issue #3327: Don't overallocate in the modules_by_index list. X-Git-Tag: v3.0rc3~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=276c3718e3aa3954026297a9effcd952ca695aa7;p=python Issue #3327: Don't overallocate in the modules_by_index list. --- diff --git a/Misc/NEWS b/Misc/NEWS index 874f27bc04..acedeb1d4b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,8 @@ What's New in Python 3.0 release candiate 3? Core and Builtins ----------------- +- Issue #3327: Don't overallocate in the modules_by_index list. + - Issue #1721812: Binary set operations and copy() returned the input type instead of the appropriate base type. This was incorrect because set subclasses would be created without their __init__() method being called. diff --git a/Python/pystate.c b/Python/pystate.c index 2a9b7443f9..fe5de5f4d2 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -234,7 +234,7 @@ _PyState_AddModule(PyObject* module, struct PyModuleDef* def) if (!def) return -1; if (!state->modules_by_index) { - state->modules_by_index = PyList_New(20); + state->modules_by_index = PyList_New(0); if (!state->modules_by_index) return -1; }