#include "simgrid/s4u/Host.hpp"
#include <lauxlib.h>
-XBT_LOG_NEW_DEFAULT_CATEGORY(lua_host, "Lua Host module");
-
constexpr char HOST_MODULE_NAME[] = "simgrid.host";
constexpr char HOST_FIELDNAME[] = "__simgrid_host";
lua_getfield(L, index, HOST_FIELDNAME);
sg_host_t *pi = (sg_host_t *) luaL_checkudata(L, lua_gettop(L), HOST_MODULE_NAME);
lua_pop(L, 1);
- if (pi == nullptr)
- XBT_ERROR("luaL_checkudata() returned nullptr");
+ xbt_assert(pi != nullptr, "luaL_checkudata() returned nullptr");
sg_host_t ht = *pi;
if (not ht)
luaL_error(L, "null Host");
/* metatable.__index = simgrid.host
* we put the host functions inside the host userdata itself:
- * this allows to write my_host:method(args) for
+ * this allows one to write my_host:method(args) for
* simgrid.host.method(my_host, args) */
lua_setfield(L, -2, "__index"); /* simgrid simgrid.host mt */