X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f50a3b14cac88d8c6db2219f5a2c79696770ed6d..42337b86be6c581a3e76ac7e346a5157541357df:/src/smpi/bindings/smpi_pmpi_request.cpp diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 7d6a45dd53..78db9c0bde 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -461,12 +461,12 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst, int size = datatype->get_extent() * count; xbt_assert(size > 0); - void* recvbuf = xbt_new0(char, size); - retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status); + std::vector recvbuf(size); + retval = + MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf.data(), count, datatype, src, recvtag, comm, status); if(retval==MPI_SUCCESS){ - simgrid::smpi::Datatype::copy(recvbuf, count, datatype, buf, count, datatype); + simgrid::smpi::Datatype::copy(recvbuf.data(), count, datatype, buf, count, datatype); } - xbt_free(recvbuf); return retval; }