Skip to content

Commit

Permalink
Update ravi-jit-infra.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Feb 11, 2015
1 parent f30a0f6 commit 9804712
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions readthedocs/ravi-jit-infra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9804712

Please sign in to comment.