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 f288d1aa21
commit 5f8219393f
10 changed files with 25 additions and 16 deletions

View File

@@ -1623,7 +1623,7 @@ struct repository *repo UNUSED)
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;
@@ -1664,7 +1664,7 @@ struct repository *repo UNUSED)
wt_status_print(&s);
wt_status_collect_free_buffers(&s);
enable_fscache(0);
disable_fscache();
return 0;
}