18 #define LuaService LuaTLSFService 20 #define LuaService LuaService 41 << this->getOwner()->getName() <<
": failed to create tlsf pool (" 56 <<
"cannot create state: not enough memory" <<
endlog();
71 this->addOperation(
"exec_file", &LuaService::exec_file,
this)
72 .doc(
"load (and run) the given lua script")
73 .arg(
"filename",
"filename of the lua script");
75 this->addOperation(
"exec_str", &LuaService::exec_str,
this)
76 .doc(
"evaluate the given string in the lua environment")
77 .arg(
"lua-string",
"string of lua code to evaluate");
80 this->addOperation(
"tlsf_incmem", &LuaService::tlsf_incmem,
this,
OwnThread)
81 .doc(
"increase the TLSF memory pool")
82 .arg(
"size",
"size in bytes to add to pool");
87 LuaService::~LuaService()
99 bool LuaService::tlsf_incmem(
unsigned int size)
105 bool LuaService::exec_file(
const std::string &file)
108 if (luaL_dofile(L, file.c_str())) {
116 bool LuaService::exec_str(
const std::string &str)
119 if (luaL_dostring(L, str.c_str())) {
#define TLSF_INITIAL_POOLSIZE
#define lua_tostring(L, i)
int tlsf_rtt_init_mp(struct lua_tlsf_info *tlsf_inf, size_t sz)
#define ORO_SERVICE_NAMED_PLUGIN(SERVICE, NAME)
int set_context_tc(TaskContext *tc, lua_State *L)
LUA_API lua_State *() lua_newstate(lua_Alloc f, void *ud)
void set_context_tlsf_info(struct lua_tlsf_info *tlsf_inf)
int luaopen_rtt(lua_State *L)
LUA_API int() lua_gc(lua_State *L, int what, int data)
LUA_API void() lua_close(lua_State *L)
void tlsf_rtt_free_mp(struct lua_tlsf_info *tlsf_inf)
int tlsf_rtt_incmem(struct lua_tlsf_info *tlsf_inf, size_t sz)
#define lua_pushcfunction(L, f)
void register_tlsf_api(lua_State *L)
LUA_API void() lua_call(lua_State *L, int nargs, int nresults)
void * tlsf_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
static Logger::LogFunction endlog()