XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc,
"Logging specific to mc_page_snapshot");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc,
"Logging specific to mc_page_snapshot");
{
// Using mmap in order to be able to expand the region
// by relocating it somewhere else in the virtual memory
// space:
{
// Using mmap in order to be able to expand the region
// by relocating it somewhere else in the virtual memory
// space:
- void* memory = ::mmap(NULL, size << xbt_pagebits, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
- if (memory == MAP_FAILED) {
+ void* memory = ::mmap(nullptr, size << xbt_pagebits, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
+ if (memory == MAP_FAILED)
// Expand the memory region by moving it into another
// virtual memory address if necessary:
void* new_memory = mremap(this->memory_, old_bytesize, new_bytesize, MREMAP_MAYMOVE);
// Expand the memory region by moving it into another
// virtual memory address if necessary:
void* new_memory = mremap(this->memory_, old_bytesize, new_bytesize, MREMAP_MAYMOVE);
// All the pages are allocated, we need add more pages:
this->resize(2 * this->capacity_);
// All the pages are allocated, we need add more pages:
this->resize(2 * this->capacity_);
- return mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ return mmap(nullptr, getpagesize(), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
XBT_TEST_SUITE("mc_page_store", "Page store");
XBT_TEST_UNIT("base", test_mc_page_store, "Test adding/removing pages in the store")
XBT_TEST_SUITE("mc_page_store", "Page store");
XBT_TEST_UNIT("base", test_mc_page_store, "Test adding/removing pages in the store")