[pypy-dev] Biting off more than I can chew
Greg Bowyer
gbowyer at fastmail.co.uk
Fri Feb 24 22:23:30 CET 2012
Thats pretty awesome.
So if anyone else is willing to join in a challange, I have an example
first steps piece of C that uses the azul interfaces to attempt to grab
a blob of
memory.
https://bitbucket.org/GregBowyer/pypy-c4gc/raw/1889f31b43e5/azm_mem_test/test.c
I was expecting my code to not work for the printf, however it does not
actually seem to do the mreserve
Anyone want to join my insanity ?
-- Greg
On 20/02/12 16:24, Amaury Forgeot d'Arc wrote:
> 2012/2/21 Greg Bowyer <gbowyer at fastmail.co.uk
> <mailto:gbowyer at fastmail.co.uk>>
>
> My question (probably one of many to irritate and annoy all the
> fine folks here) would be, is there a sensible way to compile into
> pypy a small amount of C code that can be used to bootstrap and
> bridge some esoteric c libraries into pypy, the code that I want
> to run, on startup of pypy would be the following
> https://bitbucket.org/GregBowyer/pypy-c4gc/changeset/0de575b3a8d1#chg-azm_mem_test/test.c
>
>
> It's not annoying at all, we use it in strategic places.
> For example, see how pypy/rlib/_rffi_stacklet.py implements a
> stacklet C library that can be used in RPython.
>
> It uses an "ExternalCompilationInfo" (eci) object:
> - separate_module_files lists the .c files you want to compile and link
> - separate_module_sources is an easy way to embed C snippets (each
> source will create a .c file)
>
> Then you can use rffi.llexternal with "compilation_info=eci"
> to declare a function defined in this library.
>
> --
> Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120224/fd6e264b/attachment.html>
More information about the pypy-dev
mailing list