[Python-Dev] Activating pymalloc

Martin v. Loewis martin@v.loewis.de
15 Mar 2002 22:12:49 +0100


Tim Peters <tim.one@comcast.net> writes:

> As I said, it's worthy of a comment.  *I* have no idea whether
> HAVE_LANGINFO_H and/or CODESET are defined on Windows.  If the correctness
> of this code *relies* on that they're not defined on Windows (as it still
> appears it does), an "#if Windows ... #error" would even be appropriate.

Correctness of this code is established throught the sequence

	if (Py_FileSystemDefaultEncoding == NULL)
	    fileencoding_uses_locale = 1;
	if (fileencoding_uses_locale) {

The only way the free can be ever executed is if
fileencoding_uses_locale. This can be only set if
Py_FileSystemDefaultEncoding was NULL at some earlier point.

Correctness of this code does not rely on whether certain defines are
defined on Windows.

Regards,
Martin