- /* find the same metatable in the father state */
- /* TODO find in visited_tables of src the pointer to the same
- * metatable in the father world, then copy the metatable from the
- * father world into dst
- */
+ /* I don't want the metatable of src, I want the father's copy of the
+ same metatable */
+
+ /* get from src the pointer to the father's copy of this metatable */
+ lua_pushstring(src, "simgrid.father_visited_tables");
+ /* src: ... udata mt "simgrid.visited_tables" */
+ lua_rawget(src, LUA_REGISTRYINDEX);
+ /* src: ... udata mt visited */
+ lua_pushvalue(src, -2);
+ /* src: ... udata mt visited mt */
+ lua_gettable(src, -2);
+ /* src: ... udata mt visited pfathermt */
+
+ /* copy the metatable from the father world into dst */