fscache: fscache takes an initial size

Update enable_fscache() to take an optional initial size parameter which is
used to initialize the hashmap so that it can avoid having to rehash as
additional entries are added.

Add a separate disable_fscache() macro to make the code clearer and easier
to read.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Ben Peart
2018-11-02 11:19:10 -04:00
committed by Johannes Schindelin
parent 4f12b0f8d4
commit 83bb9236a6
9 changed files with 24 additions and 15 deletions

View File

@@ -1566,7 +1566,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
PATHSPEC_PREFER_FULL,
prefix, argv);
enable_fscache(1);
enable_fscache(0);
if (status_format != STATUS_FORMAT_PORCELAIN &&
status_format != STATUS_FORMAT_PORCELAIN_V2)
progress_flag = REFRESH_PROGRESS;
@@ -1607,7 +1607,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
wt_status_print(&s);
wt_status_collect_free_buffers(&s);
enable_fscache(0);
disable_fscache();
return 0;
}