Skip to content

Commit

Permalink
Using stack array instead of mmap
Browse files Browse the repository at this point in the history
  • Loading branch information
KaminariOS committed Oct 15, 2023
1 parent 5db9a71 commit 1eb7fa8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/tests/kmer_radix_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ uint64_t partitioning(Shard* sh, const Configuration& config,
// cacheline_t* buffers = (cacheline_t*)std::aligned_alloc(
// CACHELINE_SIZE, sizeof(cacheline_t) * fanOut);

cacheline_t* buffers = (cacheline_t*) mmap(nullptr, /* 256*1024*1024*/ sizeof(cacheline_t) * fanOut, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
// PLOGI.printf("end mmap");
if (buffers == MAP_FAILED) {
perror("mmap");
exit(1);
}
// cacheline_t* buffers = (cacheline_t*) mmap(nullptr, /* 256*1024*1024*/ sizeof(cacheline_t) * fanOut, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
// // PLOGI.printf("end mmap");
// if (buffers == MAP_FAILED) {
// perror("mmap");
// exit(1);
// }
cacheline_t buffers[fanOut];
auto end_alloc = _rdtsc() - start_alloc;
// PLOGI.printf("IDX: %u, Partition alloc: %llu cycles", shard_idx,
// end_alloc); partitions[shard_idx] = locals;
Expand Down

0 comments on commit 1eb7fa8

Please sign in to comment.