[Python-Dev] Type of range object members
Guido van Rossum
guido at python.org
Wed Aug 16 01:28:09 CEST 2006
On 8/15/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> James Y Knight schrieb:
> > But it's the short int that you probably really want to make size
> > efficient.
>
> Only if you have many of them. And if you do, you have the problem
> of the special-cased allocator: when the many ints go away, Python
> will hold onto their memory forever.
But that's a bit of a corner case. There are plenty of cases where
ints are allocated and deallocated at a fast rate without allocating
tons of them at once, or where there's no need to reuse the same
memory for something else later. I wonder if we could have a smarter
int allocator that allocates some ints in a special array but switches
to the standard allocator if too many are being allocated?
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list