Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug two more leaks
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 18 Jul 2017 07:21:11 +0000 (09:21 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 18 Jul 2017 07:34:42 +0000 (09:34 +0200)
include/simgrid/s4u/Storage.hpp
src/s4u/s4u_storage.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c

index 854e0f9..2ece591 100644 (file)
@@ -38,7 +38,7 @@ public:
 
   xbt_dict_t getProperties();
   const char* getProperty(const char* key);
 
   xbt_dict_t getProperties();
   const char* getProperty(const char* key);
-  void setProperty(const char* key, char* value);
+  void setProperty(const char* key, const char* value);
   std::map<std::string, sg_size_t>* getContent();
 
   void setUserdata(void* data) { userdata_ = data; }
   std::map<std::string, sg_size_t>* getContent();
 
   void setUserdata(void* data) { userdata_ = data; }
index f746562..74770d9 100644 (file)
@@ -70,7 +70,7 @@ const char* Storage::getProperty(const char* key)
   return this->pimpl_->getProperty(key);
 }
 
   return this->pimpl_->getProperty(key);
 }
 
-void Storage::setProperty(const char* key, char* value)
+void Storage::setProperty(const char* key, const char* value)
 {
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 {
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
index 10ea064..db4614c 100644 (file)
@@ -98,7 +98,7 @@ static void dump_platform_storages()
 
   for (auto storage : *storages) {
     XBT_INFO("Storage %s is attached to %s", storage.first.c_str(), storage.second->getHost()->getCname());
 
   for (auto storage : *storages) {
     XBT_INFO("Storage %s is attached to %s", storage.first.c_str(), storage.second->getHost()->getCname());
-    storage.second->setProperty("other usage", xbt_strdup("gpfs"));
+    storage.second->setProperty("other usage", "gpfs");
   }
   delete storages;
 }
   }
   delete storages;
 }
index 76cce8d..ab85f5d 100644 (file)
@@ -6,6 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/msg.h"
 #include "xbt.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example");
 #include "xbt.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example");
@@ -36,8 +37,6 @@ static int crasher(int argc, char *argv[])
   int i;
   xbt_os_thread_t *crashers;
 
   int i;
   xbt_os_thread_t *crashers;
 
-  xbt_init(&argc, argv);
-
   /* initializations of the philosopher mechanisms */
   id = xbt_new0(int, crasher_amount);
   crashers = xbt_new(xbt_os_thread_t, crasher_amount);
   /* initializations of the philosopher mechanisms */
   id = xbt_new0(int, crasher_amount);
   crashers = xbt_new(xbt_os_thread_t, crasher_amount);
@@ -64,5 +63,6 @@ static int crasher(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
+  MSG_init(&argc, argv);
   return crasher(argc, argv);
 }
   return crasher(argc, argv);
 }