External references

David Malcolm dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015


On Tue, 2015-06-09 at 21:39 +0100, Dibyendu Majumdar wrote:
> If a JIT compiled function needs to call externally defined C
> functions, can I define these references in the parent context and use
> in child contexts?

Yes: you ought to be able to declare the functions with
GCC_JIT_FUNCTION_IMPORTED in the parent context to get a long-lived
gcc_jit_function * object, and then call them from child contexts.

I believe I did something like this when porting GNU Octave's JIT to
libgccjit.

I don't think there's an example of this in the docs yet (we probably
should have a tutorial showing the use of a parent context for shared
setup).

Dave



More information about the Jit mailing list