From 9804712920a67cee0786141eca20bd1fdf56a04e Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Wed, 11 Feb 2015 22:30:06 +0000 Subject: [PATCH] Update ravi-jit-infra.rst --- readthedocs/ravi-jit-infra.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readthedocs/ravi-jit-infra.rst b/readthedocs/ravi-jit-infra.rst index f44516c..16389ba 100644 --- a/readthedocs/ravi-jit-infra.rst +++ b/readthedocs/ravi-jit-infra.rst @@ -73,6 +73,16 @@ Example Usage ------------- What above does is abstracts away all the implementation details. Here is a test program that uses the above two interfaces:: + // This mirrors the Lua GCObject structure in lobject.h + typedef struct RaviGCObject { + struct RaviGCObject *next; + unsigned char b1; + unsigned char b2; + } RaviGCObject; + + // Our prototype for the JITted function + typedef int (*myfunc_t)(RaviGCObject *); + extern "C" int mytest(RaviGCObject *obj) { printf("value = %d\n", obj->b1); return obj->b1;