]> granicus.if.org Git - python/commit
Use a PyDictObject again for the array type cache; retrieving items
authorThomas Heller <theller@ctypes.org>
Thu, 24 Jan 2008 18:36:27 +0000 (18:36 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 24 Jan 2008 18:36:27 +0000 (18:36 +0000)
commite4c03e4520cdf0959cb2b0e0cc289cb1e3a0ceb4
tree38d004ce25e234a6c3f738189f90cc69adcb492d
parenteead05fdd629063adafe3edda9f1a9ca249f3173
Use a PyDictObject again for the array type cache; retrieving items
from the WeakValueDictionary was slower by nearly a factor of 3.

To avoid leaks, weakref proxies for the array types are put into the
cache dict, with weakref callbacks that removes the entries when the
type goes away.
Modules/_ctypes/_ctypes.c