47 #define LuaComponent LuaTLSFComponent 49 #define LuaComponent LuaComponent 77 <<
"': failed to allocate memory for Lua state" << endlog();
91 this->
addProperty(
"lua_string",
lua_string).doc(
"string of lua code to be executed during configureHook");
92 this->
addProperty(
"lua_file",
lua_file).doc(
"file with lua program to be executed during configuration");
95 .doc(
"load (and run) the given lua script")
96 .arg(
"filename",
"filename of the lua script");
99 .doc(
"evaluate the given string in the lua environment")
100 .arg(
"lua-string",
"string of lua code to evaluate");
104 .doc(
"increase the TLSF memory pool")
105 .arg(
"size",
"size in bytes to add to pool");
120 bool LuaComponent::tlsf_incmem(
unsigned int size)
130 if (luaL_dofile(
L, file.c_str())) {
140 if (luaL_dostring(
L, str.c_str())) {
154 return call_func(
L,
"configureHook",
this, 0, 1);
160 return call_func(
L,
"activateHook",
this, 0, 1);
bool exec_str(const std::string &str)
Property< T > & addProperty(const std::string &name, T &attr)
#define TLSF_INITIAL_POOLSIZE
#define lua_tostring(L, i)
int tlsf_rtt_init_mp(struct lua_tlsf_info *tlsf_inf, size_t sz)
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)
bool call_func(lua_State *L, const char *fname, TaskContext *tc, int require_function, int require_result)
bool exec_file(const std::string &file)
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)
Operation< Signature > & addOperation(Operation< Signature > &op)
void * tlsf_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
virtual const std::string & getName() const
ORO_CREATE_COMPONENT(OCL::logging::Log4cxxAppender)
RTT::os::MutexRecursive m
LuaStateHandle getLuaState()