Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar & codacy
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 9 Jul 2017 20:20:20 +0000 (22:20 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 9 Jul 2017 22:51:06 +0000 (00:51 +0200)
examples/msg/app-bittorrent/app-bittorrent.tesh [changed mode: 0755->0644]
examples/simdag/properties/sd_properties.tesh [changed mode: 0755->0644]
src/kernel/context/ContextThread.cpp
src/mc/ChunkedData.hpp
src/msg/msg_io.cpp
src/xbt/memory_map.cpp
src/xbt/mmalloc/mmalloc.c

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3e28c30..85ac35a 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -115,7 +114,7 @@ ThreadContext::ThreadContext(std::function<void()> code,
     * name, but now the name is stored at SIMIX level, so we pass a null  */
     this->thread_ =
       xbt_os_thread_create(nullptr,
     * name, but now the name is stored at SIMIX level, so we pass a null  */
     this->thread_ =
       xbt_os_thread_create(nullptr,
-        maestro ? ThreadContext::maestro_wrapper : ThreadContext::wrapper,
+        maestro ? &ThreadContext::maestro_wrapper : &ThreadContext::wrapper,
         this, this);
     /* wait the starting of the newly created process */
     xbt_os_sem_acquire(this->end_);
         this, this);
     /* wait the starting of the newly created process */
     xbt_os_sem_acquire(this->end_);
index 891e2fa..330f2c9 100644 (file)
@@ -49,9 +49,10 @@ public:
 
   // Copy and move
   ChunkedData(ChunkedData const& that)
 
   // Copy and move
   ChunkedData(ChunkedData const& that)
+     : store_ (that.store_)
+     , pagenos_(that.pagenos_)
+            
   {
   {
-    store_ = that.store_;
-    pagenos_ = that.pagenos_;
     for (std::size_t pageno : pagenos_)
       store_->ref_page(pageno);
   }
     for (std::size_t pageno : pagenos_)
       store_->ref_page(pageno);
   }
index 2c0b61b..b479145 100644 (file)
@@ -93,7 +93,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
   /* Find the host where the file is physically located and read it */
   msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
   msg_host_t attached_host            = storage_src->getHost();
   /* Find the host where the file is physically located and read it */
   msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
   msg_host_t attached_host            = storage_src->getHost();
-  read_size                           = fd->read(size); // TODO re-add attached_host;
+  read_size                           = fd->read(size); // TODO re-add attached_host
 
   if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
 
   if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
@@ -158,7 +158,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
   }
   /* Write file on local or remote host */
   // sg_size_t offset     = fd->tell();
   }
   /* Write file on local or remote host */
   // sg_size_t offset     = fd->tell();
-  sg_size_t write_size = fd->write(size); // TODO readd attached_host;
+  sg_size_t write_size = fd->write(size); // TODO readd attached_host
 
   return write_size;
 }
 
   return write_size;
 }
index 3bb597d..ae6113c 100644 (file)
@@ -339,6 +339,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
       memreg.prot |= PROT_EXEC;
 
     /* Private (copy-on-write) or shared? */
       memreg.prot |= PROT_EXEC;
 
     /* Private (copy-on-write) or shared? */
+    memreg.flags = 0;
     if (vmentries[i].kve_flags & KVME_FLAG_COW)
       memreg.flags |= MAP_PRIVATE;
     else
     if (vmentries[i].kve_flags & KVME_FLAG_COW)
       memreg.flags |= MAP_PRIVATE;
     else
index 35baa0f..ee9dee9 100644 (file)
@@ -1,7 +1,6 @@
 /* Memory allocator `malloc'. */
 
 /* Memory allocator `malloc'. */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -269,7 +268,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
        If we loop completely around without finding a large enough
        space we will have to get more memory from the system.  */
     size_t blocks = BLOCKIFY(size);
        If we loop completely around without finding a large enough
        space we will have to get more memory from the system.  */
     size_t blocks = BLOCKIFY(size);
-    size_t start = block = MALLOC_SEARCH_START;
+    size_t start  = MALLOC_SEARCH_START;
+    block         = MALLOC_SEARCH_START;
     while (mdp->heapinfo[block].free_block.size < blocks) {
       if (mdp->heapinfo[block].type >=0) { // Don't trust xbt_die and friends in malloc-level library, you fool!
         fprintf(stderr,"Internal error: found a free block not marked as such (block=%lu type=%lu). Please report this bug.\n",(unsigned long)block,(unsigned long)mdp->heapinfo[block].type);
     while (mdp->heapinfo[block].free_block.size < blocks) {
       if (mdp->heapinfo[block].type >=0) { // Don't trust xbt_die and friends in malloc-level library, you fool!
         fprintf(stderr,"Internal error: found a free block not marked as such (block=%lu type=%lu). Please report this bug.\n",(unsigned long)block,(unsigned long)mdp->heapinfo[block].type);