Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use #include <...> for foreign header files.
[simgrid.git] / src / xbt / memory_map.cpp
index b54dce6..2d54b6a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2023. 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. */
@@ -65,8 +65,7 @@
   } else                                                                                                               \
     ((void)0)
 
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
 
 /**
  * \todo This function contains many cases that do not allow for a
@@ -203,7 +202,7 @@ std::vector<VmMap> get_memory_map(pid_t pid)
 #elif defined __linux__
   /* Open the actual process's proc maps file and create the memory_map_t */
   /* to be returned. */
-  std::string path = std::string("/proc/") + std::to_string(pid) + "/maps";
+  std::string path = "/proc/" + std::to_string(pid) + "/maps";
   std::ifstream fp;
   fp.rdbuf()->pubsetbuf(nullptr, 0);
   fp.open(path);
@@ -419,5 +418,4 @@ std::vector<VmMap> get_memory_map(pid_t pid)
   return ret;
 }
 
-}
-}
+} // namespace simgrid::xbt