On Fri, Jul 2, 2010 at 1:37 AM, Hakan Ardo <[email protected]> wrote: > Hi, > I've got a simple implementation of array now, wrapping lltype.malloc > with no error checking yet (cStringIO was great help, thx). How can I > test this with the jit? Do I need to translate the entire pypy or is > there a quicker way? > >> there. In case of _rawffi, probably a couple of hints for the jit to >> not look inside some functions (which do external calls for example) >> should also be needed, since for example JIT as of now does not >> support raw mallocs (using C malloc and not our GC). Still, making an >> array module interp-level is probably the sanest approach. > > Do I need to guard the lltype.malloc call with such hints? What is the syntax? >
I can see into making raw_malloc just a call from JIT. That shouldn't be a big issue. For now you can either: a) use from pypy.rlib import rgc and use rgc.malloc_nonmovable (not sure if jit'll like it), so you'll get a gc-managed non-movable memory b) just wrap call to malloc in a function with decorator dont_look_inside (from pypy.rlib.jit) _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
