X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b9625f82f86db0674e911887addce45dca31b57f..f8856118321c58129177e1392dbd03be2db142af:/src/smpi/internals/smpi_memory.cpp diff --git a/src/smpi/internals/smpi_memory.cpp b/src/smpi/internals/smpi_memory.cpp index 394dbb4ee0..794d88e4f7 100644 --- a/src/smpi/internals/smpi_memory.cpp +++ b/src/smpi/internals/smpi_memory.cpp @@ -55,10 +55,10 @@ void smpi_prepare_global_memory_segment() static void smpi_get_executable_global_size() { - char buffer[PATH_MAX]; - const char* full_name = realpath(simgrid::xbt::binary_name.c_str(), buffer); - xbt_assert(full_name != nullptr, "Could not resolve real path of binary file '%s'", - simgrid::xbt::binary_name.c_str()); + char* buffer = realpath(simgrid::xbt::binary_name.c_str(), nullptr); + xbt_assert(buffer != nullptr, "Could not resolve real path of binary file '%s'", simgrid::xbt::binary_name.c_str()); + std::string full_name = buffer; + free(buffer); std::vector map = simgrid::xbt::get_memory_map(getpid()); for (auto i = map.begin(); i != map.end() ; ++i) { @@ -176,7 +176,7 @@ void* smpi_temp_shm_mmap(int fd, size_t size) return mem; } -/** Map a given SMPI privatization segment (make a SMPI process active) +/** Map a given SMPI privatization segment (make an SMPI process active) * * When doing a state restoration, the state of the restored variables might not be consistent with the state of the * virtual memory. In this case, we to change the data segment.