Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ add_benchmark(adjacent_difference src/adjacent_difference.cpp)
add_benchmark(bitset_from_string src/bitset_from_string.cpp)
add_benchmark(bitset_to_string src/bitset_to_string.cpp)
add_benchmark(efficient_nonlocking_print src/efficient_nonlocking_print.cpp)
add_benchmark(filesystem src/filesystem.cpp)
add_benchmark(find_and_count src/find_and_count.cpp)
add_benchmark(find_first_of src/find_first_of.cpp)
add_benchmark(iota src/iota.cpp)
Expand Down
22 changes: 22 additions & 0 deletions benchmarks/src/filesystem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <benchmark/benchmark.h>
#include <filesystem>
#include <system_error>

void symlink_status(benchmark::State& state) {
const auto path = std::filesystem::temp_directory_path();

for (auto _ : state) {
std::error_code ec;
Comment thread
StephanTLavavej marked this conversation as resolved.
benchmark::DoNotOptimize(path);
const auto status = std::filesystem::symlink_status(path, ec);
Comment thread
StephanTLavavej marked this conversation as resolved.
benchmark::DoNotOptimize(status);
Comment thread
StephanTLavavej marked this conversation as resolved.
benchmark::DoNotOptimize(ec);
}
}

BENCHMARK(symlink_status);

BENCHMARK_MAIN();
7 changes: 7 additions & 0 deletions stl/src/filesystem.cpp
Comment thread
StephanTLavavej marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,13 @@ namespace {

_Flags &= ~_Get_file_attributes_data;
}

if (!_STD _Bitmask_includes_any(_Attributes, __std_fs_file_attr::_Reparse_point)
&& _STD _Bitmask_includes_any(_Flags, __std_fs_stats_flags::_Reparse_tag)) {
// if reparse tag is requested by caller but the file is not a reparse point, set tag to _None
_Stats->_Reparse_point_tag = __std_fs_reparse_tag::_None;
_Flags &= ~__std_fs_stats_flags::_Reparse_tag;
}
Comment thread
StephanTLavavej marked this conversation as resolved.
}
}

Expand Down