Minor compilation problem on HP-UX (1.6b1)

Eddy De Greef degreef at imec.be
Mon Aug 7 04:59:30 EDT 2000


Hi,

when I compile version 1.6b1 on HP-UX-10, I get a few compilation errors 
in Python/getargs.c (undefined UCHAR_MAX etc). The following patch fixes this:

------------------------------------------------------------------------------
*** Python/getargs.c.orig       Mon Aug  7 10:19:55 2000
--- Python/getargs.c    Mon Aug  7 10:20:21 2000
***************
*** 8,13 ****
--- 8,14 ----
  #include "Python.h"
  
  #include <ctype.h>
+ #include <limits.h>
  
  
  int PyArg_Parse Py_PROTO((PyObject *, char *, ...));
------------------------------------------------------------------------------

I also have a suggestion to improve the speed on the HP-UX platform. 
By tuning the memory allocation algorithm (see the patch below), it is 
possible to obtain a speed improvement of up to 22% on non-trivial 
Python scripts, especially when lots of (small) objects have to be created. 
I'm aware that platform-specific features are undesirable for a 
multi-platform application such as Python, but 22% is quite a lot
for such a small modification ...
Maybe similar tricks can be used on other platforms too.

------------------------------------------------------------------------------
*** Modules/main.c.orig Mon Aug  7 10:02:09 2000
--- Modules/main.c      Mon Aug  7 10:02:37 2000
***************
*** 83,88 ****
--- 83,92 ----
        orig_argc = argc;       /* For Py_GetArgcArgv() */
        orig_argv = argv;
  
+ #ifdef __hpux
+       mallopt (M_MXFAST, 512);
+ #endif /* __hpux */
+ 
        if ((p = getenv("PYTHONINSPECT")) && *p != '\0')
                inspect = 1;
        if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
------------------------------------------------------------------------------

Regards,

Eddy



More information about the Python-list mailing list