Skip to content

Commit

Permalink
Made parameter name more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Sep 19, 2023
1 parent 0e4e0b9 commit 2a1df7b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/microbenchmark-pages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
#include <windows.h>
#endif

#define PAGE_SIZE 3194
// Good: 3194, Bad: 3195.
#define PAGE_SIZE 4096

#ifndef OBJECT_DISTANCE
#define OBJECT_DISTANCE PAGE_SIZE
#endif

template <typename T>
std::ostream& operator<<(std::ostream& o, const std::vector<T>& v) {
Expand Down Expand Up @@ -118,10 +121,13 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) {
sleepDelay = atoi(env);
}

std::cout << "Object size: " << OBJECT_SIZE << std::endl;
std::cout << "Object distance: " << OBJECT_DISTANCE << std::endl;

std::vector<void*> objects;
objects.reserve(N);

const auto freed = litter(OBJECT_SIZE, N);
const auto freed = litter(OBJECT_SIZE, N, std::random_device()(), OBJECT_DISTANCE);

if (sleepDelay) {
#ifdef _WIN32
Expand Down

0 comments on commit 2a1df7b

Please sign in to comment.