Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
check for alloc mem
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 4 Apr 2021 17:13:53 +0000 (19:13 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 4 Apr 2021 17:13:53 +0000 (19:13 +0200)
src/smpi/bindings/smpi_pmpi.cpp

index 99501be..6b1c4dc 100644 (file)
@@ -214,6 +214,7 @@ int PMPI_Initialized(int* flag) {
 
 int PMPI_Alloc_mem(MPI_Aint size, MPI_Info /*info*/, void* baseptr)
 {
+  CHECK_NEGATIVE(1, MPI_ERR_COUNT, size)
   void *ptr = xbt_malloc(size);
   *static_cast<void**>(baseptr) = ptr;
   return MPI_SUCCESS;