<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thats pretty awesome.<br>
    <br>
    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 <br>
    memory.<br>
    <br>
<a class="moz-txt-link-freetext" href="https://bitbucket.org/GregBowyer/pypy-c4gc/raw/1889f31b43e5/azm_mem_test/test.c">https://bitbucket.org/GregBowyer/pypy-c4gc/raw/1889f31b43e5/azm_mem_test/test.c</a><br>
    <br>
    I was expecting my code to not work for the printf, however it does
    not actually seem to do the mreserve<br>
    <br>
    Anyone want to join my insanity ?<br>
    <br>
    -- Greg<br>
    <br>
    On 20/02/12 16:24, Amaury Forgeot d'Arc wrote:
    <blockquote
cite="mid:CAGmFidZHpY6wFu5MAd4PNQ6Cjkv3PWHSLeCWEmG4OvPgKYumHQ@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">2012/2/21 Greg Bowyer <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:gbowyer@fastmail.co.uk">gbowyer@fastmail.co.uk</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div id=":2zf">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 <a moz-do-not-send="true"
href="https://bitbucket.org/GregBowyer/pypy-c4gc/changeset/0de575b3a8d1#chg-azm_mem_test/test.c"
              target="_blank">https://bitbucket.org/GregBowyer/pypy-c4gc/changeset/0de575b3a8d1#chg-azm_mem_test/test.c</a></div>
        </blockquote>
        <div><br>
        </div>
        <div>It's not annoying at all, we use it in strategic places.</div>
        <div>For example, see how pypy/rlib/_rffi_stacklet.py implements
          a</div>
        <div>stacklet C library that can be used in RPython.</div>
        <div><br>
        </div>
        <div>It uses an "ExternalCompilationInfo" (eci) object:</div>
        <div>-&nbsp;separate_module_files lists the .c files you want to
          compile and link</div>
        <div>- separate_module_sources is an easy way to embed C
          snippets (each source will create a .c file)</div>
        <div><br>
        </div>
        <div>Then you can use&nbsp;rffi.llexternal with
          "compilation_info=eci"</div>
        <div>to declare a function defined in this library.</div>
        <div><br>
        </div>
      </div>
      -- <br>
      Amaury Forgeot d'Arc<br>
    </blockquote>
    <br>
  </body>
</html>