Le 15/01/2021 à 13:08, Julien Danjou a écrit :
> On Fri, Jan 15 2021, Antoine Pitrou wrote:
> 
>> Also note that PyObject_Malloc() may also be used to allocate
>> non-objects, for example a bytearray's payload, IIRC.
> 
> Interesting. What's the rational for not using PyMem_Malloc() in such
> cases?

I think PyMem_Malloc() just redirects to PyObject_Malloc() nowadays.
Historically though, PyMem_Malloc() was a thin wrapper around the system
malloc(), and it could therefore be slower than PyObject_Malloc() for
small payloads.

Regards

Antoine.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/6OH6N6YAGL6MRFJVOGLV3UYY5JCDRQKN/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to