BUG? PyMem_Free vs strdup

Robin Becker robin at jessikat.fsnet.co.uk
Wed Nov 5 19:16:36 CET 2003


In article <mailman.469.1068054736.702.python-list at python.org>, Skip
Montanaro <skip at pobox.com> writes
......
>Memory allocated by strdup() should almost certainly be freed with free(),
>not PyMem_Free().

Yes you're right. 
>
>    Robin> Is there an easy way to get a grasp on the various memory
>    Robin> allocation functions?
>
>Sure.  Keep your allocations and deallocations within the same family of
>functions. ;-)
>
>Skip
>
in the beginning there was only the primordial heap and now I have
PyMem_Free, art_free, free and probably gt1_free grrhhhh!

They all used to commingle quite happily and seem to do so under the
non-debug case, but now I suppose we're being stricter and stricter. I
suppose M$ spends all its money on marketing and fails to get the best
possible allocator.
-- 
Robin Becker




More information about the Python-list mailing list