Author loewis
Recipients brian.curtin, loewis, neologix, pitrou, tim.golden
Date 2011-11-29.20:48:32
SpamBayes Score 3.08598e-12
Marked as misclassified No
Message-id <1322599713.77.0.0140691590909.issue13483@psf.upfronthosting.co.za>
In-reply-to
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.

The CRT heap, in turn, is created with HeapCreate (no flags).

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).

If we take the route proposed by this patch, I recommend also dropping all other CRT malloc() calls in Python, and make allocations from the process heap instead (that's a separate issue, though).
History
Date User Action Args
2011-11-29 20:48:33loewissetrecipients: + loewis, pitrou, tim.golden, brian.curtin, neologix
2011-11-29 20:48:33loewissetmessageid: <1322599713.77.0.0140691590909.issue13483@psf.upfronthosting.co.za>
2011-11-29 20:48:33loewislinkissue13483 messages
2011-11-29 20:48:33loewiscreate