Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 17 May 2019 07:11:20 +0000 (09:11 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 17 May 2019 07:11:20 +0000 (09:11 +0200)
1  2 
src/smpi/internals/smpi_global.cpp

@@@ -214,7 -214,7 +214,7 @@@ void smpi_comm_copy_buffer_callback(sim
    XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff, comm->dst_buff_);
    memcpy_private(comm->dst_buff_, tmpbuff, private_blocks);
  
 -  if (comm->detached_) {
 +  if (comm->detached()) {
      // if this is a detached send, the source buffer was duplicated by SMPI
      // sender to make the original buffer available to the application ASAP
      xbt_free(buff);
@@@ -507,7 -507,7 +507,7 @@@ static void smpi_copy_file(const std::s
  #endif
    // If this point is reached, sendfile() actually is not available.  Copy file by hand.
    const int bufsize = 1024 * 1024 * 4;
-   char buf[bufsize];
+   char* buf         = new char[bufsize];
    while (int got = read(fdin, buf, bufsize)) {
      if (got == -1) {
        xbt_assert(errno == EINTR, "Cannot read from %s", src.c_str());
        }
      }
    }
+   delete[] buf;
    close(fdin);
    close(fdout);
  }