Re: [Python-Dev] PyMem_MALLOC vs PyMem_Malloc

2010-11-01 Thread Hirokazu Yamamoto
On 2010/10/31 2:32, M.-A. Lemburg wrote: M.-A. Lemburg wrote: Hirokazu Yamamoto wrote: Hello. I found several codes using PyMem_Free to free allocated memory with PyMem_MALLOC (ie: PyUnicode_AsWideCharString) Is it safe? Within the interpreter: yes. In extensions: depends on the platform, b

Re: [Python-Dev] PyMem_MALLOC vs PyMem_Malloc

2010-10-30 Thread M.-A. Lemburg
M.-A. Lemburg wrote: > Hirokazu Yamamoto wrote: >> Hello. I found several codes using PyMem_Free to free >> allocated memory with PyMem_MALLOC (ie: PyUnicode_AsWideCharString) >> >> Is it safe? > > Within the interpreter: yes. > > In extensions: depends on the platform, but probably not. > > The

Re: [Python-Dev] PyMem_MALLOC vs PyMem_Malloc

2010-10-30 Thread M.-A. Lemburg
Hirokazu Yamamoto wrote: > Hello. I found several codes using PyMem_Free to free > allocated memory with PyMem_MALLOC (ie: PyUnicode_AsWideCharString) > > Is it safe? Within the interpreter: yes. In extensions: depends on the platform, but probably not. The macros provide faster access to the C