mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Optimize overall memory usage
* Fixes in otbm loader * Rework BinaryTree
This commit is contained in:
@@ -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()
|
||||
|
@@ -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"
|
||||
|
||||
|
Reference in New Issue
Block a user