[Python-Dev] PEP 445: Add new APIs to customize Python memory allocators (second round)
Nick Coghlan
ncoghlan at gmail.com
Thu Jun 20 15:34:44 CEST 2013
On 20 June 2013 22:16, Antoine Pitrou <solipsis at pitrou.net> wrote:
> Le Thu, 20 Jun 2013 13:26:52 +0200,
> Victor Stinner <victor.stinner at gmail.com> a écrit :
>
>> Hi,
>>
>> I changed the PEP 445 according to the discussing on python-dev.
>>
>> Read it online:
>> http://www.python.org/dev/peps/pep-0445/
>>
>> Changes:
>>
>> * add PyMemAllocatorDomain enum: PYALLOC_PYMEM_RAW, PYALLOC_PYMEM or
>> PYALLOC_PYOBJECT
>
> PYMEM_DOMAIN_RAW?
The challenge there is coming up with a good name for PYALLOC_PYMEM.
I think Victor's names for the domains work well:
- "PYALLOC_" prefix to say "this is an allocation domain"
- "PYMEM_RAW" suffix for PyMem_RawMalloc/Realloc/Free
- "PYMEM" suffix for PyMem_Malloc/Realloc/Free
- "PYOBJECT" suffix for PyObject_Malloc/Realloc/Free
Although, there's a copy-and-paste error in the domain definitions (2
*Reallocs in each entry and no *Frees).
If Guido doesn't want to do it, I'm happy to. Antoine would be a good
choice too, since he's the one who suggested taking the time to thrash
out the API details in a PEP (which I agree has substantially improved
the end result).
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list