X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/15c81e44412415173de220954a453019c68714cd..ea39fd08c260e7faa92334952d4acd37e3892b6c:/src/bindings/lua/simgrid_lua.c diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index b4b3763b8d..6eb8d7ef21 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -185,7 +185,11 @@ static int get_clock(lua_State* L) { */ static int simgrid_gc(lua_State * L) { - MSG_clean(); + // There is no need to cleanup the C world anymore, as it gets cleaned at system process closing automatically + // Maybe at some point we'll want to reintroduce this, for example when encapsulating the simulation properly + //if (sglua_is_maestro(L)) { + // MSG_clean(); + //} return 0; } @@ -194,7 +198,7 @@ static int simgrid_gc(lua_State * L) */ static int msg_register_platform(lua_State * L) { - /* Tell Simgrid we dont wanna use its parser */ + /* Tell Simgrid we don't wanna use its parser */ //surf_parse = console_parse_platform; surf_parse_reset_callbacks(); MSG_create_environment(NULL); @@ -204,7 +208,6 @@ static int msg_register_platform(lua_State * L) /* * Register platform for Simdag */ - static int sd_register_platform(lua_State * L) { //surf_parse = console_parse_platform_wsL07; @@ -317,7 +320,8 @@ int luaopen_simgrid(lua_State *L) argv[argc--] = NULL; /* Initialize the MSG core */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); + MSG_process_set_data_cleanup((void_f_pvoid_t) lua_close); XBT_DEBUG("Still %d arguments on command line", argc); // FIXME: update the lua's arg table to reflect the changes from SimGrid } @@ -439,7 +443,7 @@ static int run_lua_code(int argc, char **argv) * \param err an MSG error code * \return a string describing this error */ -const char* sglua_get_msg_error(MSG_error_t err) { +const char* sglua_get_msg_error(msg_error_t err) { static const char* msg_errors[] = { NULL,