Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Hide a gcc attribute that drives doxygen nuts
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 29 Apr 2017 21:42:06 +0000 (23:42 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 29 Apr 2017 21:53:08 +0000 (23:53 +0200)
include/simgrid/s4u/Mutex.hpp
src/mc/PageStore.cpp
src/mc/PageStore.hpp
src/mc/mc_mmu.h
src/mc/mc_snapshot.h

index a0f8c0c..3603d18 100644 (file)
@@ -22,9 +22,9 @@ class ConditionVariable;
 /** @brief A classical mutex, but blocking in the simulation world
  *  @ingroup s4u_api
  *
 /** @brief A classical mutex, but blocking in the simulation world
  *  @ingroup s4u_api
  *
- * It is strictly impossible to use a real mutex (such as
+ * It is strictly impossible to use a real mutexsuch as
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex)
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex)
- * or [pthread_mutex_t](http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_mutex_lock.html)),
+ * or [pthread_mutex_t](http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_mutex_lock.html),
  * because it would block the whole simulation.
  * Instead, you should use the present class, that is a drop-in replacement of
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex).
  * because it would block the whole simulation.
  * Instead, you should use the present class, that is a drop-in replacement of
  * [std::mutex](http://en.cppreference.com/w/cpp/thread/mutex).
index 90bfa3e..a8e149a 100644 (file)
@@ -36,8 +36,7 @@ namespace mc {
  *  @param data Memory page
  *  @return hash off the page
  */
  *  @param data Memory page
  *  @return hash off the page
  */
-static inline  __attribute__ ((always_inline))
-PageStore::hash_type mc_hash_page(const void* data)
+static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
 {
   const std::uint64_t* values = (const uint64_t*) data;
   std::size_t n = xbt_pagesize / sizeof(uint64_t);
 {
   const std::uint64_t* values = (const uint64_t*) data;
   std::size_t n = xbt_pagesize / sizeof(uint64_t);
index bb6be39..640e63c 100644 (file)
@@ -157,37 +157,33 @@ public: // Debug/test methods
 
 };
 
 
 };
 
-inline __attribute__((always_inline))
-void PageStore::unref_page(std::size_t pageno) {
+XBT_ALWAYS_INLINE void PageStore::unref_page(std::size_t pageno)
+{
   if ((--this->page_counts_[pageno]) == 0)
     this->remove_page(pageno);
 }
 
   if ((--this->page_counts_[pageno]) == 0)
     this->remove_page(pageno);
 }
 
-inline __attribute__((always_inline))
-void PageStore::ref_page(size_t pageno)
+XBT_ALWAYS_INLINE void PageStore::ref_page(size_t pageno)
 {
   ++this->page_counts_[pageno];
 }
 
 {
   ++this->page_counts_[pageno];
 }
 
-inline __attribute__((always_inline))
-const void* PageStore::get_page(std::size_t pageno) const
+XBT_ALWAYS_INLINE const void* PageStore::get_page(std::size_t pageno) const
 {
   return (void*) simgrid::mc::mmu::join(pageno, (std::uintptr_t) this->memory_);
 }
 
 {
   return (void*) simgrid::mc::mmu::join(pageno, (std::uintptr_t) this->memory_);
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::get_ref(std::size_t pageno)
+XBT_ALWAYS_INLINE std::size_t PageStore::get_ref(std::size_t pageno)
 {
   return this->page_counts_[pageno];
 }
 
 {
   return this->page_counts_[pageno];
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::size() {
+XBT_ALWAYS_INLINE std::size_t PageStore::size()
+{
   return this->top_index_ - this->free_pages_.size();
 }
 
   return this->top_index_ - this->free_pages_.size();
 }
 
-inline __attribute__((always_inline))
-std::size_t PageStore::capacity()
+XBT_ALWAYS_INLINE std::size_t PageStore::capacity()
 {
   return this->capacity_;
 }
 {
   return this->capacity_;
 }
index eb6d337..9e2aaa5 100644 (file)
@@ -31,8 +31,7 @@ static int chunkSize()
  *  @param size Byte size
  *  @return Number of memory pages
  */
  *  @param size Byte size
  *  @return Number of memory pages
  */
-static inline __attribute__ ((always_inline))
-std::size_t chunkCount(std::size_t size)
+static XBT_ALWAYS_INLINE std::size_t chunkCount(std::size_t size)
 {
   size_t page_count = size >> xbt_pagebits;
   if (size & (xbt_pagesize-1))
 {
   size_t page_count = size >> xbt_pagebits;
   if (size & (xbt_pagesize-1))
@@ -41,8 +40,7 @@ std::size_t chunkCount(std::size_t size)
 }
 
 /** @brief Split into chunk number and remaining offset */
 }
 
 /** @brief Split into chunk number and remaining offset */
-static inline __attribute__ ((always_inline))
-std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
+static XBT_ALWAYS_INLINE std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 {
   return {
     offset >> xbt_pagebits,
 {
   return {
     offset >> xbt_pagebits,
@@ -51,20 +49,17 @@ std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 }
 
 /** Merge chunk number and remaining offset info a global offset */
 }
 
 /** Merge chunk number and remaining offset info a global offset */
-static inline __attribute__ ((always_inline))
-std::uintptr_t join(std::size_t page, std::uintptr_t offset)
+static XBT_ALWAYS_INLINE std::uintptr_t join(std::size_t page, std::uintptr_t offset)
 {
   return ((std::uintptr_t) page << xbt_pagebits) + offset;
 }
 
 {
   return ((std::uintptr_t) page << xbt_pagebits) + offset;
 }
 
-static inline __attribute__ ((always_inline))
-std::uintptr_t join(std::pair<std::size_t,std::uintptr_t> value)
+static XBT_ALWAYS_INLINE std::uintptr_t join(std::pair<std::size_t, std::uintptr_t> value)
 {
   return join(value.first, value.second);
 }
 
 {
   return join(value.first, value.second);
 }
 
-static inline __attribute__ ((always_inline))
-bool sameChunk(std::uintptr_t a, std::uintptr_t b)
+static XBT_ALWAYS_INLINE bool sameChunk(std::uintptr_t a, std::uintptr_t b)
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
index 8fbba24..c217c97 100644 (file)
@@ -34,8 +34,7 @@ SG_BEGIN_DECL()
 
 XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg);
 
 
 XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg);
 
-static inline __attribute__((always_inline))
-void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
+static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
 {
   auto split = simgrid::mc::mmu::split(addr - region->start().address());
   auto pageno = split.first;
 {
   auto split = simgrid::mc::mmu::split(addr - region->start().address());
   auto pageno = split.first;
@@ -44,8 +43,7 @@ void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region
   return (char*) snapshot_page + offset;
 }
 
   return (char*) snapshot_page + offset;
 }
 
-static inline __attribute__((always_inline))
-void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
+static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
 {
   switch (region->storage_type()) {
   case simgrid::mc::StorageType::NoData:
 {
   switch (region->storage_type()) {
   case simgrid::mc::StorageType::NoData:
@@ -156,8 +154,8 @@ public: // To be private
 
 extern "C" {
 
 
 extern "C" {
 
-static inline __attribute__ ((always_inline))
-mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot, int process_index, mc_mem_region_t region)
+static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
+                                                              int process_index, mc_mem_region_t region)
 {
   if (region->contain(simgrid::mc::remote(addr)))
     return region;
 {
   if (region->contain(simgrid::mc::remote(addr)))
     return region;
@@ -198,8 +196,7 @@ XBT_PRIVATE int MC_snapshot_memcmp(
   const void* addr1, simgrid::mc::Snapshot* snapshot1,
   const void* addr2, simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
 
   const void* addr1, simgrid::mc::Snapshot* snapshot1,
   const void* addr2, simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
 
-static inline __attribute__ ((always_inline))
-const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
+static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
 {
   if(snapshot==nullptr)
       xbt_die("snapshot is nullptr");
 {
   if(snapshot==nullptr)
       xbt_die("snapshot is nullptr");
@@ -214,9 +211,8 @@ const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
  *  @param size    Size of the data to read in bytes
  *  @return Pointer where the data is located (target buffer of original location)
  */
  *  @param size    Size of the data to read in bytes
  *  @return Pointer where the data is located (target buffer of original location)
  */
-static inline __attribute__((always_inline))
-const void* MC_region_read(
-  mc_mem_region_t region, void* target, const void* addr, std::size_t size)
+static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void* target, const void* addr,
+                                                    std::size_t size)
 {
   xbt_assert(region);
 
 {
   xbt_assert(region);
 
@@ -254,8 +250,7 @@ const void* MC_region_read(
   }
 }
 
   }
 }
 
-static inline __attribute__ ((always_inline))
-void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
+static XBT_ALWAYS_INLINE void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
 {
   void* res;
   return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
 {
   void* res;
   return *(void**) MC_region_read(region, &res, addr, sizeof(void*));