Skip to content

Commit

Permalink
LibC: Tune the number of ChunkedBlocks we keep around empty.
Browse files Browse the repository at this point in the history
At the moment, both mmap() and munmap() are kind of slow. Compiling with GCC
was suffering quite badly from munmap() slowness, so let's keep a few more
of the ChunkedBlocks around after they are empty, to avoid having to munmap.
  • Loading branch information
awesomekling committed May 2, 2019
1 parent b4e7925 commit 66e401d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LibC/malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define MAGIC_BIGALLOC_HEADER 0x42697267
#define PAGE_ROUND_UP(x) ((((size_t)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)))

static const size_t number_of_chunked_blocks_to_keep_around_per_size_class = 4;
static const size_t number_of_chunked_blocks_to_keep_around_per_size_class = 32;

static bool s_log_malloc = false;
static bool s_scrub_malloc = true;
Expand Down

0 comments on commit 66e401d

Please sign in to comment.