This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients brian.curtin, loewis, neologix, pitrou, tim.golden
Date 2011-11-29.21:02:08
SpamBayes Score 3.6807555e-09
Marked as misclassified No
Message-id <1322600223.3292.23.camel@localhost.localdomain>
In-reply-to <1322599713.77.0.0140691590909.issue13483@psf.upfronthosting.co.za>
Content
> The patch looks good to me.
> 
> To study Microsoft's malloc, see VC\crt\src\malloc.c. Typically, it
> uses HeapAlloc from the CRT heap, unless it's in 32-bit mode, and
> __active_heap is either __V6_HEAP or __V5_HEAP. This is determined at
> startup by __heap_select, inspecting an environment variable
> __MSVCRT_HEAP_SELECT. If that's not set, the CRT heap is used.

Ah, right, I guessed it was using HeapAlloc indeed. What would be more
interesting is how HeapAlloc works :)

I think it would be nice to know whether the patch has a chance of being
useful before committing it. I did it as a thought experiment after the
similar change was committed for Unix, but I'm not an expert in Windows
internals. Perhaps HeapAlloc deals fine with fragmentation? Tim, Brian,
do you know anything about this?

> As an alternative approach, Python could consider completely dropping
> obmalloc on Windows, and using a Windows Low Fragementation Heap (LFH)
> instead, with HEAP_NO_SERIALIZE (as the heap would be protected by the
> GIL).

I'm not sure that would serve the same purpose as obmalloc, which
(AFAIU) is very fast at the expense of compacity.
History
Date User Action Args
2011-11-29 21:02:09pitrousetrecipients: + pitrou, loewis, tim.golden, brian.curtin, neologix
2011-11-29 21:02:08pitroulinkissue13483 messages
2011-11-29 21:02:08pitroucreate