diff options
Diffstat (limited to 'Carpet/CarpetLib/src/mem.hh')
-rw-r--r-- | Carpet/CarpetLib/src/mem.hh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/mem.hh b/Carpet/CarpetLib/src/mem.hh index dbd976c21..fe8694d32 100644 --- a/Carpet/CarpetLib/src/mem.hh +++ b/Carpet/CarpetLib/src/mem.hh @@ -24,7 +24,7 @@ public: T * memptr = NULL, size_t memsize = 0); ~mem (); - T * storage (size_t vectorindex) const + T * storage (size_t vectorindex) const CCTK_ATTRIBUTE_PURE { assert (vectorindex < vectorlength_); assert (clients_.AT(vectorindex)); @@ -33,13 +33,15 @@ public: void register_client (size_t vectorindex); void unregister_client (size_t vectorindex); - bool has_clients () const; + bool has_clients () const CCTK_ATTRIBUTE_PURE; // Memory usage - size_t memory () const; + size_t memory () const CCTK_ATTRIBUTE_PURE; }; template<typename T> +inline size_t memoryof (mem<T> const & m) CCTK_ATTRIBUTE_PURE; +template<typename T> inline size_t memoryof (mem<T> const & m) { return m.memory(); } @@ -84,9 +86,10 @@ public: void * alloc (size_t nbytes); // Memory usage - size_t memory () const; + size_t memory () const CCTK_ATTRIBUTE_PURE; }; +inline size_t memoryof (mempool const & m) CCTK_ATTRIBUTE_PURE; inline size_t memoryof (mempool const & m) { return m.memory(); } #endif // ifndef MEM_HH |