Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Coding style: camel case Buffer
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Mar 2016 09:08:55 +0000 (10:08 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Mar 2016 09:09:02 +0000 (10:09 +0100)
src/mc/RegionSnapshot.cpp
src/mc/RegionSnapshot.hpp

index a045b2f..8bf91df 100644 (file)
@@ -39,7 +39,7 @@ const char* to_cstr(RegionType region)
   }
 }
 
-buffer::buffer(std::size_t size, Type type) : size_(size), type_(type)
+Buffer::Buffer(std::size_t size, Type type) : size_(size), type_(type)
 {
   switch(type_) {
   case Type::Malloc:
@@ -59,7 +59,7 @@ buffer::buffer(std::size_t size, Type type) : size_(size), type_(type)
   }
 }
 
-void buffer::clear() noexcept
+void Buffer::clear() noexcept
 {
   switch(type_) {
   case Type::Malloc:
@@ -81,16 +81,16 @@ RegionSnapshot dense_region(
   RegionType region_type,
   void *start_addr, void* permanent_addr, size_t size)
 {
-  simgrid::mc::buffer::Type buffer_type;
+  simgrid::mc::Buffer::Type buffer_type;
   if (_sg_mc_ksm)
     // We use mmap to allocate the memory in order to madvise it.
     // We don't want to madvise the main heap.
     // Moreover we get aligned pgaes which is merge-friendly.
-    buffer_type = simgrid::mc::buffer::Type::Mmap;
+    buffer_type = simgrid::mc::Buffer::Type::Mmap;
   else
-    buffer_type = simgrid::mc::buffer::Type::Malloc;
+    buffer_type = simgrid::mc::Buffer::Type::Malloc;
 
-  simgrid::mc::buffer data(size, buffer_type);
+  simgrid::mc::Buffer data(size, buffer_type);
 
   mc_model_checker->process().read_bytes(data.get(), size,
     remote(permanent_addr),
index f1007ac..0214d89 100644 (file)
@@ -37,7 +37,7 @@ enum class StorageType {
   Privatized = 3
 };
 
-class buffer {
+class Buffer {
 public:
   enum class Type {
     Malloc,
@@ -48,26 +48,26 @@ private:
   std::size_t size_;
   Type type_ = Type::Malloc;
 public:
-  buffer() {}
-  buffer(std::size_t size, Type type = Type::Malloc);
-  buffer(void* data, std::size_t size, Type type = Type::Malloc) :
+  Buffer() {}
+  Buffer(std::size_t size, Type type = Type::Malloc);
+  Buffer(void* data, std::size_t size, Type type = Type::Malloc) :
     data_(data), size_(size), type_(type) {}
   void clear() noexcept;
-  ~buffer() noexcept { clear(); }
+  ~Buffer() noexcept { clear(); }
 
   // No copy
-  buffer(buffer const& buffer) = delete;
-  buffer& operator=(buffer const& buffer) = delete;
+  Buffer(Buffer const& buffer) = delete;
+  Buffer& operator=(Buffer const& buffer) = delete;
 
   // Move
-  buffer(buffer&& that) noexcept
+  Buffer(Buffer&& that) noexcept
     : data_(that.data_), size_(that.size_), type_(that.type_)
   {
     that.data_ = nullptr;
     that.size_ = 0;
     that.type_ = Type::Malloc;
   }
-  buffer& operator=(buffer&& that) noexcept
+  Buffer& operator=(Buffer&& that) noexcept
   {
     clear();
     data_ = that.data_;
@@ -130,7 +130,7 @@ private:
    * */
   void *permanent_addr_;
 
-  buffer flat_data_;
+  Buffer flat_data_;
   ChunkedData page_numbers_;
   std::vector<RegionSnapshot> privatized_regions_;
 public:
@@ -204,15 +204,15 @@ public:
     privatized_regions_.clear();
   }
   
-  void flat_data(buffer data)
+  void flat_data(Buffer data)
   {
     storage_type_ = StorageType::Flat;
     flat_data_ = std::move(data);
     page_numbers_.clear();
     privatized_regions_.clear();
   }
-  const buffer& flat_data() const { return flat_data_; }
-  buffer& flat_data()             { return flat_data_; }
+  const Buffer& flat_data() const { return flat_data_; }
+  Buffer& flat_data()             { return flat_data_; }
 
   void page_data(ChunkedData page_data)
   {