On Wed, Oct 28, 2009 at 10:19 PM, Mark Lodato <[email protected]> wrote: > On Wed, Oct 28, 2009 at 11:26 AM, Stefan Behnel <[email protected]> wrote: >> Robert Bradshaw, 28.10.2009 10:45: >>> >>> http://trac.cython.org/cython_trac/ticket/439 >> >> Mark, thanks a lot for doing that. I hope you copied the wchar_t adaptation >> part from somewhere, looks like a lot of work otherwise. >> >> [snip] >> >> Another thing I noticed is the use of PyMem_Malloc() and friends. I'm not >> sure if it's safe to use those before initialising the Python interpreter. >> Anyway, I think that plain malloc() and free() make more sense here. > > I copied this almost verbatim from Python 3.1.1's Modules/python.c. I > assume using PyMem is fine since CPython does it, but I default to > your judgment... >
IMHO, then changes to Modules/python.c in Python 3 are a mess... Perhaps I'm missing somenthing, but I fail to the point of using PyMem_XXX there... I'm not going to reject your implementation for using the PyMem_XXX functions, but I would prefer plain malloc()/free() being used.. I do this in mpi4py, tough this re-rubuilt interpreter is not usually required: http://code.google.com/p/mpi4py/source/browse/trunk/src/python.c >> One thing that strikes me, however, is the amount of code duplication. I >> think we should put cython_freeze into the Cython package (e.g. as >> Cython/Compiler/MainFunction.py), so that the compiler can use it to >> generate a main() function, and just add a __main__ execution body at the >> end that runs from the command line. Distutils could still install the >> module as a "cython_freeze" script in /usr/bin then, and the shipped >> bin/cython_freeze would simply import and run >> Cython/Compiler/MainFunction.py (so that you don't need to install Cython >> to get a runnable script). > > Yes, I agree entirely. Once this gets tested and finalized, I think > it would be great to merge cython_freeze into Cython as you suggest. > Unfortunately, I don't know how to proceed... :) > OK... I'm completely lost here... I'll need to actually review the beast to make more coments, sorry... -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
