}
}
-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:
}
}
-void buffer::clear() noexcept
+void Buffer::clear() noexcept
{
switch(type_) {
case Type::Malloc:
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),
Privatized = 3
};
-class buffer {
+class Buffer {
public:
enum class Type {
Malloc,
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_;
* */
void *permanent_addr_;
- buffer flat_data_;
+ Buffer flat_data_;
ChunkedData page_numbers_;
std::vector<RegionSnapshot> privatized_regions_;
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)
{