Skip to content

Commit

Permalink
issue #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibyendu Majumdar committed Sep 28, 2016
1 parent 354d219 commit 434afa8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion include/lobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
#define LUA_TNUMFLT (LUA_TNUMBER | (0 << 4)) /* float numbers */
#define LUA_TNUMINT (LUA_TNUMBER | (1 << 4)) /* integer numbers */

#define RAVI_TIARRAY (LUA_TTABLE | (1 << 4)) /* Ravi int array */
#define RAVI_TFARRAY (LUA_TTABLE | (2 << 4)) /* Ravi float array */


/* Bit mark for collectable types */
#define BIT_ISCOLLECTABLE (1 << 6)
Expand Down Expand Up @@ -148,7 +151,10 @@ typedef struct lua_TValue {
#define ttisstring(o) checktype((o), LUA_TSTRING)
#define ttisshrstring(o) checktag((o), ctb(LUA_TSHRSTR))
#define ttislngstring(o) checktag((o), ctb(LUA_TLNGSTR))
#define ttistable(o) checktag((o), ctb(LUA_TTABLE))
#define ttistable(o) checktype((o), LUA_TTABLE)
#define ttisiarray(o) checktag((o), ctb(RAVI_TIARRAY))
#define ttisfarray(o) checktag((o), ctb(RAVI_TFARRAY))
#define ttisLtable(o) checktag((o), ctb(LUA_TTABLE))
#define ttisfunction(o) checktype(o, LUA_TFUNCTION)
#define ttisclosure(o) ((rttype(o) & 0x1F) == LUA_TFUNCTION)
#define ttisCclosure(o) checktag((o), ctb(LUA_TCCL))
Expand Down Expand Up @@ -252,6 +258,17 @@ typedef struct lua_TValue {
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTABLE)); \
checkliveness(L,io); }

#define setiarrayvalue(L,obj,x) \
{ TValue *io = (obj); Table *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(RAVI_TIARRAY)); \
checkliveness(L,io); }

#define setfarrayvalue(L,obj,x) \
{ TValue *io = (obj); Table *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(RAVI_TFARRAY)); \
checkliveness(L,io); }


#define setdeadvalue(obj) settt_(obj, LUA_TDEADKEY)


Expand Down
2 changes: 1 addition & 1 deletion include/ravi_llvmcodegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum LuaTypeCode {
LUA__TLIGHTUSERDATA = LUA_TLIGHTUSERDATA,
LUA__TNUMBER = LUA_TNUMBER,
LUA__TSTRING = ctb(LUA_TSTRING),
LUA__TTABLE = ctb(LUA_TTABLE),
LUA__TTABLE = LUA_TTABLE,
LUA__TFUNCTION = ctb(LUA_TFUNCTION),
LUA__TUSERDATA = ctb(LUA_TUSERDATA),
LUA__TTHREAD = ctb(LUA_TTHREAD),
Expand Down

0 comments on commit 434afa8

Please sign in to comment.