X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/be3155e24d0c71e2bbd31dd282cfd49bff7290fa..4f566b4572ad07940ea23d86d4af4abeaed7b4c7:/examples/s4u/io/s4u_io.cpp diff --git a/examples/s4u/io/s4u_io.cpp b/examples/s4u/io/s4u_io.cpp index b3aaa11a71..7499e4d774 100644 --- a/examples/s4u/io/s4u_io.cpp +++ b/examples/s4u/io/s4u_io.cpp @@ -4,9 +4,8 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include -#include -#include "simgrid/s4u.h" +#include "simgrid/s4u.hpp" XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category"); @@ -67,6 +66,7 @@ public: // Test attaching some user data to the file file->setUserdata(xbt_strdup("777")); XBT_INFO("User data attached to the file: %s", (char*)file->userdata()); + xbt_free(file->userdata()); // Close the file delete file; @@ -77,26 +77,6 @@ public: storage.setUserdata(xbt_strdup("Some user data")); XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata()); - - /* - // Dump disks contents - XBT_INFO("*** Dump content of %s ***",Host::current()->name()); - xbt_dict_t contents = NULL; - contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts - xbt_dict_cursor_t curs, curs2 = NULL; - char* mountname; - xbt_dict_t content; - char* path; - sg_size_t *size; - xbt_dict_foreach(contents, curs, mountname, content){ - XBT_INFO("Print the content of mount point: %s",mountname); - xbt_dict_foreach(content,curs2,path,size){ - XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size)); - } - xbt_dict_free(&content); - } - xbt_dict_free(&contents); - */ } }; @@ -104,7 +84,7 @@ int main(int argc, char **argv) { simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); e->loadPlatform("../../platforms/storage/storage.xml"); - simgrid::s4u::Actor("host", simgrid::s4u::Host::by_name("denise"), MyHost()); + simgrid::s4u::Actor::createActor("host", simgrid::s4u::Host::by_name("denise"), MyHost()); e->run(); return 0; }