Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call munmap with the size in smpi_shared_free.
authorTom Cornebize <tom.cornebize@ensimag.grenoble-inp.fr>
Fri, 14 Apr 2017 09:23:49 +0000 (11:23 +0200)
committerTom Cornebize <tom.cornebize@ensimag.grenoble-inp.fr>
Fri, 14 Apr 2017 09:23:49 +0000 (11:23 +0200)
src/smpi/smpi_shared.cpp

index 04c73f6..6715971 100644 (file)
@@ -427,7 +427,7 @@ void smpi_shared_free(void *ptr)
         xbt_free(meta->second.data);
     }
 
-    munmap(ptr, 0); // the POSIX says that I should not give 0 as a length, but it seems to work OK
+    munmap(ptr, meta->second.size);
   } else {
     XBT_DEBUG("Classic free of %p", ptr);
     xbt_free(ptr);