[libcxx-commits] [libcxx] [libcxx] Cache file attributes during directory iteration. (PR #93316)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 3 07:46:33 PDT 2024
================
@@ -328,6 +369,12 @@ class directory_entry {
case _RefreshNonSymlink:
case _RefreshSymlink:
return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
+# if _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_FULLY_POPULATED_CACHED_ENTRY
+ case _IterCachedSymlink:
+ return __status(__p_, __ec);
+ case _IterCachedNonSymlink:
+ return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
+# endif // _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_FULLY_POPULATED_CACHED_ENTRY
----------------
ldionne wrote:
In retrospect, it might have been a better idea to implement these functions in the dylib, that way all of this would have been kept synchronized by construction. But here we are.
Nothing to change with this comment, just kinda ranting about it.
https://github.com/llvm/llvm-project/pull/93316
More information about the libcxx-commits
mailing list