From 22b5d20a7e430ab8d5b69ef1e6a422309d45814d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 5 Jul 2017 17:31:44 +0200 Subject: [PATCH] make it clear to static analyzers that this mem is not leaked --- examples/s4u/actions-comm/s4u_actions-comm.cpp | 3 ++- examples/s4u/actions-storage/s4u_actions-storage.cpp | 3 ++- examples/s4u/actor-daemon/s4u_actor-daemon.cpp | 1 - examples/s4u/actor-kill/s4u_actor-kill.cpp | 2 ++ examples/s4u/actor-migration/s4u_actor-migration.cpp | 1 + examples/s4u/actor-suspend/s4u_actor-suspend.cpp | 4 ++-- examples/s4u/app-masterworker/s4u_app-masterworker.cpp | 3 ++- examples/s4u/app-token-ring/s4u_app-token-ring.cpp | 4 +++- examples/s4u/dht-chord/s4u_dht-chord.cpp | 3 ++- examples/s4u/io/s4u_io.cpp | 3 ++- examples/s4u/mutex/s4u_mutex.cpp | 4 +++- teshsuite/s4u/actor/actor.cpp | 1 + teshsuite/s4u/concurrent_rw/concurrent_rw.cpp | 4 ++-- teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp | 5 +++-- teshsuite/s4u/listen_async/listen_async.cpp | 2 ++ teshsuite/s4u/pid/pid.cpp | 4 ++-- .../s4u/storage_client_server/storage_client_server.cpp | 4 ++-- 17 files changed, 33 insertions(+), 18 deletions(-) diff --git a/examples/s4u/actions-comm/s4u_actions-comm.cpp b/examples/s4u/actions-comm/s4u_actions-comm.cpp index 44b42d1b8c..523f3a4192 100644 --- a/examples/s4u/actions-comm/s4u_actions-comm.cpp +++ b/examples/s4u/actions-comm/s4u_actions-comm.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -117,5 +117,6 @@ int main(int argc, char *argv[]) XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/examples/s4u/actions-storage/s4u_actions-storage.cpp b/examples/s4u/actions-storage/s4u_actions-storage.cpp index 21f9e13952..3b4858160a 100644 --- a/examples/s4u/actions-storage/s4u_actions-storage.cpp +++ b/examples/s4u/actions-storage/s4u_actions-storage.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -133,5 +133,6 @@ int main(int argc, char* argv[]) XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/examples/s4u/actor-daemon/s4u_actor-daemon.cpp b/examples/s4u/actor-daemon/s4u_actor-daemon.cpp index bc075a6ca5..b415f288b4 100644 --- a/examples/s4u/actor-daemon/s4u_actor-daemon.cpp +++ b/examples/s4u/actor-daemon/s4u_actor-daemon.cpp @@ -40,6 +40,5 @@ int main(int argc, char* argv[]) e->run(); delete e; - return 0; } diff --git a/examples/s4u/actor-kill/s4u_actor-kill.cpp b/examples/s4u/actor-kill/s4u_actor-kill.cpp index 16794c7e33..e6a77aaf7f 100644 --- a/examples/s4u/actor-kill/s4u_actor-kill.cpp +++ b/examples/s4u/actor-kill/s4u_actor-kill.cpp @@ -48,5 +48,7 @@ int main(int argc, char* argv[]) e->run(); /* - Run the simulation */ XBT_INFO("Simulation time %g", e->getClock()); + + delete e; return 0; } diff --git a/examples/s4u/actor-migration/s4u_actor-migration.cpp b/examples/s4u/actor-migration/s4u_actor-migration.cpp index 5db96c6313..f0fe008570 100644 --- a/examples/s4u/actor-migration/s4u_actor-migration.cpp +++ b/examples/s4u/actor-migration/s4u_actor-migration.cpp @@ -72,5 +72,6 @@ int main(int argc, char* argv[]) XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/examples/s4u/actor-suspend/s4u_actor-suspend.cpp b/examples/s4u/actor-suspend/s4u_actor-suspend.cpp index a4d6dc45c1..0c59d04d45 100644 --- a/examples/s4u/actor-suspend/s4u_actor-suspend.cpp +++ b/examples/s4u/actor-suspend/s4u_actor-suspend.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -77,5 +76,6 @@ int main(int argc, char* argv[]) e->run(); /* - Run the simulation */ + delete e; return 0; } diff --git a/examples/s4u/app-masterworker/s4u_app-masterworker.cpp b/examples/s4u/app-masterworker/s4u_app-masterworker.cpp index bc5d34a138..776425d112 100644 --- a/examples/s4u/app-masterworker/s4u_app-masterworker.cpp +++ b/examples/s4u/app-masterworker/s4u_app-masterworker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -102,5 +102,6 @@ int main(int argc, char* argv[]) XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/examples/s4u/app-token-ring/s4u_app-token-ring.cpp b/examples/s4u/app-token-ring/s4u_app-token-ring.cpp index 266b60cf73..c2d375b372 100644 --- a/examples/s4u/app-token-ring/s4u_app-token-ring.cpp +++ b/examples/s4u/app-token-ring/s4u_app-token-ring.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -66,5 +66,7 @@ int main(int argc, char** argv) } e->run(); XBT_INFO("Simulation time %g", e->getClock()); + + delete e; return 0; } diff --git a/examples/s4u/dht-chord/s4u_dht-chord.cpp b/examples/s4u/dht-chord/s4u_dht-chord.cpp index db79af6405..2c5ed697a4 100644 --- a/examples/s4u/dht-chord/s4u_dht-chord.cpp +++ b/examples/s4u/dht-chord/s4u_dht-chord.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -76,5 +76,6 @@ int main(int argc, char* argv[]) chord_exit(); + delete e; return 0; } diff --git a/examples/s4u/io/s4u_io.cpp b/examples/s4u/io/s4u_io.cpp index d9cd197265..a09685da12 100644 --- a/examples/s4u/io/s4u_io.cpp +++ b/examples/s4u/io/s4u_io.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -87,5 +87,6 @@ int main(int argc, char **argv) e->loadPlatform("../../platforms/storage/storage.xml"); simgrid::s4u::Actor::createActor("host", simgrid::s4u::Host::by_name("denise"), MyHost()); e->run(); + delete e; return 0; } diff --git a/examples/s4u/mutex/s4u_mutex.cpp b/examples/s4u/mutex/s4u_mutex.cpp index 5e384847a1..2f2afd9ccd 100644 --- a/examples/s4u/mutex/s4u_mutex.cpp +++ b/examples/s4u/mutex/s4u_mutex.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -64,5 +64,7 @@ int main(int argc, char **argv) e->loadPlatform("../../platforms/two_hosts.xml"); simgrid::s4u::Actor::createActor("main", simgrid::s4u::Host::by_name("Tremblay"), master); e->run(); + + delete e; return 0; } diff --git a/teshsuite/s4u/actor/actor.cpp b/teshsuite/s4u/actor/actor.cpp index 3be9b1239e..c742c2b41e 100644 --- a/teshsuite/s4u/actor/actor.cpp +++ b/teshsuite/s4u/actor/actor.cpp @@ -62,5 +62,6 @@ int main(int argc, char* argv[]) e->run(); XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp index 82a0ca894c..692701a3e4 100644 --- a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp +++ b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2008-2010, 2012-2015, 2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -50,5 +49,6 @@ int main(int argc, char** argv) e->run(); XBT_INFO("Simulation time %g", e->getClock()); + delete e; return 0; } diff --git a/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp b/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp index 31f1bbc2e8..17f378df6b 100644 --- a/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp +++ b/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2010-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -37,5 +36,7 @@ int main(int argc, char* argv[]) e->run(); XBT_INFO("Simulation time %g", e->getClock()); + + delete e; return 0; } diff --git a/teshsuite/s4u/listen_async/listen_async.cpp b/teshsuite/s4u/listen_async/listen_async.cpp index 991f201445..c1a0364c0c 100644 --- a/teshsuite/s4u/listen_async/listen_async.cpp +++ b/teshsuite/s4u/listen_async/listen_async.cpp @@ -51,5 +51,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Actor::createActor("test", simgrid::s4u::Host::by_name("Tremblay"), server); e->run(); + + delete e; return 0; } diff --git a/teshsuite/s4u/pid/pid.cpp b/teshsuite/s4u/pid/pid.cpp index fc5882dd96..02a57342bf 100644 --- a/teshsuite/s4u/pid/pid.cpp +++ b/teshsuite/s4u/pid/pid.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -55,5 +54,6 @@ int main(int argc, char* argv[]) e->run(); + delete e; return 0; } diff --git a/teshsuite/s4u/storage_client_server/storage_client_server.cpp b/teshsuite/s4u/storage_client_server/storage_client_server.cpp index 0dcfafd4cf..a7316d0c5e 100644 --- a/teshsuite/s4u/storage_client_server/storage_client_server.cpp +++ b/teshsuite/s4u/storage_client_server/storage_client_server.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2013-2015, 2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -173,5 +172,6 @@ int main(int argc, char* argv[]) XBT_INFO("Simulated time: %g", e->getClock()); + delete e; return 0; } -- 2.20.1