Optimize overall memory usage

* Fixes in otbm loader
* Rework BinaryTree
This commit is contained in:
Eduardo Bart
2012-07-15 10:23:13 -03:00
parent 03ca792dbd
commit 7a08fed689
25 changed files with 376 additions and 186 deletions

View File

@@ -721,7 +721,10 @@ void LuaInterface::error()
int LuaInterface::ref()
{
return luaL_ref(L, LUA_REGISTRYINDEX);
int ref = luaL_ref(L, LUA_REGISTRYINDEX);
assert(ref != LUA_NOREF);
assert(ref < 2147483647);
return ref;
}
int LuaInterface::weakRef()

View File

@@ -27,6 +27,7 @@
/// LuaObject, all script-able classes have it as base
// @bindclass
#pragma pack(push,1) // disable memory alignment
class LuaObject : public std::enable_shared_from_this<LuaObject>
{
public:
@@ -88,6 +89,7 @@ private:
int m_fieldsTableRef;
int m_metatableRef;
};
#pragma pack(pop)
#include "luainterface.h"