[libcxx-commits] [libcxx] [libcxx] Cache file attributes during directory iteration. (PR #93316)
Eduard Satdarov via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 19 08:03:11 PDT 2024
================
@@ -201,7 +201,11 @@ class directory_entry {
_IterNonSymlink,
_RefreshSymlink,
_RefreshSymlinkUnresolved,
- _RefreshNonSymlink
+ _RefreshNonSymlink,
+# if _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_FULLY_POPULATED_CACHED_ENTRY
----------------
ed-sat wrote:
I had thoughts about reusing `_IterSymlink` and `_IterNonSymlink` in my first attempt to add caching and I faced that I would be kinda difficult because in that case I should store information about cached or not properties depending on platform Windows and others. And also based on that knowledge rewrite many functions with enum switch by adding for each case with `_IterSymlink` and `_IterNonSymlink` additional login which quite similar to '_IterCachedSymlink' and '_IterCachedNonSymlink'
In that case each plain enum switch will become enum with additional if else.
https://github.com/llvm/llvm-project/pull/93316
More information about the libcxx-commits
mailing list