diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-07-30 19:23:14 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-07-30 19:23:14 +0000 |
commit | 40beacac031f579786f8b26aa16c59486dbab2b0 (patch) | |
tree | 12a1548bbf15daf6e931eaca2fcd6a9e618d0356 /library/cpp | |
parent | ea1b205d749cc1c3e37c7ae42817534ede33e390 (diff) | |
parent | f7ca71b582e2347ec55857b493d6bccf55bbc3df (diff) | |
download | ydb-40beacac031f579786f8b26aa16c59486dbab2b0.tar.gz |
Merge branch 'rightlib' into mergelibs-240730-1922
Diffstat (limited to 'library/cpp')
109 files changed, 390 insertions, 8 deletions
diff --git a/library/cpp/accurate_accumulate/benchmark/metrics/ya.make b/library/cpp/accurate_accumulate/benchmark/metrics/ya.make index 5c7ccf91974..b8334316e78 100644 --- a/library/cpp/accurate_accumulate/benchmark/metrics/ya.make +++ b/library/cpp/accurate_accumulate/benchmark/metrics/ya.make @@ -1,3 +1,4 @@ + PY2TEST() SIZE(LARGE) diff --git a/library/cpp/accurate_accumulate/benchmark/ya.make b/library/cpp/accurate_accumulate/benchmark/ya.make index 3dc032e7ee0..614332bafa0 100644 --- a/library/cpp/accurate_accumulate/benchmark/ya.make +++ b/library/cpp/accurate_accumulate/benchmark/ya.make @@ -1,3 +1,4 @@ + Y_BENCHMARK() BENCHMARK_OPTS(--budget=10) diff --git a/library/cpp/accurate_accumulate/ya.make b/library/cpp/accurate_accumulate/ya.make index b4bca269583..9e69d8ba135 100644 --- a/library/cpp/accurate_accumulate/ya.make +++ b/library/cpp/accurate_accumulate/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( accurate_accumulate.h accurate_accumulate.cpp diff --git a/library/cpp/balloc/setup/ya.make b/library/cpp/balloc/setup/ya.make index 90bb97ea288..6666ca00e61 100644 --- a/library/cpp/balloc/setup/ya.make +++ b/library/cpp/balloc/setup/ya.make @@ -2,6 +2,7 @@ LIBRARY() NO_UTIL() + IF ("${YMAKE}" MATCHES "devtools") CFLAGS(-DYMAKE=1) ENDIF() diff --git a/library/cpp/binsaver/ut/ya.make b/library/cpp/binsaver/ut/ya.make index de198b31a45..9a207536b42 100644 --- a/library/cpp/binsaver/ut/ya.make +++ b/library/cpp/binsaver/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/binsaver) + SRCS( binsaver_ut.cpp ) diff --git a/library/cpp/binsaver/ut_util/ya.make b/library/cpp/binsaver/ut_util/ya.make index 39b6c955b23..c83bc697304 100644 --- a/library/cpp/binsaver/ut_util/ya.make +++ b/library/cpp/binsaver/ut_util/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( ut_util.cpp ) diff --git a/library/cpp/binsaver/ya.make b/library/cpp/binsaver/ya.make index ae26fa93c16..4c8344575d1 100644 --- a/library/cpp/binsaver/ya.make +++ b/library/cpp/binsaver/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( class_factory.h bin_saver.cpp diff --git a/library/cpp/bucket_quoter/ya.make b/library/cpp/bucket_quoter/ya.make index d74141e39d2..2ab24a02844 100644 --- a/library/cpp/bucket_quoter/ya.make +++ b/library/cpp/bucket_quoter/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( bucket_quoter.cpp ) diff --git a/library/cpp/case_insensitive_string/ut/ya.make b/library/cpp/case_insensitive_string/ut/ya.make index 85db6ec4681..1a3cfdc9747 100644 --- a/library/cpp/case_insensitive_string/ut/ya.make +++ b/library/cpp/case_insensitive_string/ut/ya.make @@ -1,3 +1,4 @@ + UNITTEST_FOR(library/cpp/case_insensitive_string) SRCS( diff --git a/library/cpp/case_insensitive_string/ya.make b/library/cpp/case_insensitive_string/ya.make index b05f1671187..c953de0fea4 100644 --- a/library/cpp/case_insensitive_string/ya.make +++ b/library/cpp/case_insensitive_string/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS( diff --git a/library/cpp/codecs/float_huffman_bench/ya.make b/library/cpp/codecs/float_huffman_bench/ya.make index cc1bf1c7795..f6b0c3d27a3 100644 --- a/library/cpp/codecs/float_huffman_bench/ya.make +++ b/library/cpp/codecs/float_huffman_bench/ya.make @@ -1,3 +1,4 @@ + G_BENCHMARK() SRCS( diff --git a/library/cpp/codecs/greedy_dict/ut/ya.make b/library/cpp/codecs/greedy_dict/ut/ya.make index acb110d061d..f9e85e47033 100644 --- a/library/cpp/codecs/greedy_dict/ut/ya.make +++ b/library/cpp/codecs/greedy_dict/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/codecs/greedy_dict) + SRCS( greedy_dict_ut.cpp ) diff --git a/library/cpp/codecs/greedy_dict/ya.make b/library/cpp/codecs/greedy_dict/ya.make index f4b2714f419..be290ca36be 100644 --- a/library/cpp/codecs/greedy_dict/ya.make +++ b/library/cpp/codecs/greedy_dict/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS( diff --git a/library/cpp/compproto/ut/ya.make b/library/cpp/compproto/ut/ya.make index 2686f5b4804..fee3fb6e4f7 100644 --- a/library/cpp/compproto/ut/ya.make +++ b/library/cpp/compproto/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( ADDINCL library/cpp/compproto ) diff --git a/library/cpp/compproto/ya.make b/library/cpp/compproto/ya.make index dc9ad86f035..dd8fdcaae8b 100644 --- a/library/cpp/compproto/ya.make +++ b/library/cpp/compproto/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( bit.h compressor.h diff --git a/library/cpp/comptable/usage/ya.make b/library/cpp/comptable/usage/ya.make index e622cc106e5..b56ae6736f1 100644 --- a/library/cpp/comptable/usage/ya.make +++ b/library/cpp/comptable/usage/ya.make @@ -1,5 +1,6 @@ PROGRAM() + SRCS( usage.cpp ) diff --git a/library/cpp/comptable/ut/ya.make b/library/cpp/comptable/ut/ya.make index d98ecad7b68..71966923e4c 100644 --- a/library/cpp/comptable/ut/ya.make +++ b/library/cpp/comptable/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/comptable) + SRCS( comptable_ut.cpp ) diff --git a/library/cpp/comptable/ya.make b/library/cpp/comptable/ya.make index a4e6e286d2f..38ec34d6c11 100644 --- a/library/cpp/comptable/ya.make +++ b/library/cpp/comptable/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( comptable.cpp ) diff --git a/library/cpp/containers/2d_array/ya.make b/library/cpp/containers/2d_array/ya.make index 50aa2a5f8b8..05d030ff1c8 100644 --- a/library/cpp/containers/2d_array/ya.make +++ b/library/cpp/containers/2d_array/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( 2d_array.cpp ) diff --git a/library/cpp/containers/compact_vector/ut/ya.make b/library/cpp/containers/compact_vector/ut/ya.make index 1a84894570a..9b8de053815 100644 --- a/library/cpp/containers/compact_vector/ut/ya.make +++ b/library/cpp/containers/compact_vector/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + SRCDIR(library/cpp/containers/compact_vector) SRCS( diff --git a/library/cpp/containers/compact_vector/ya.make b/library/cpp/containers/compact_vector/ya.make index b7d97b13536..0084e68830d 100644 --- a/library/cpp/containers/compact_vector/ya.make +++ b/library/cpp/containers/compact_vector/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( compact_vector.cpp ) diff --git a/library/cpp/containers/comptrie/benchmark/ya.make b/library/cpp/containers/comptrie/benchmark/ya.make index 1fded11a948..27bb87a40ea 100644 --- a/library/cpp/containers/comptrie/benchmark/ya.make +++ b/library/cpp/containers/comptrie/benchmark/ya.make @@ -2,6 +2,7 @@ Y_BENCHMARK() TAG(ya:not_autocheck) + SRCS( main.cpp ) diff --git a/library/cpp/containers/comptrie/ya.make b/library/cpp/containers/comptrie/ya.make index 8931bfb3835..875ce79d178 100644 --- a/library/cpp/containers/comptrie/ya.make +++ b/library/cpp/containers/comptrie/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( array_with_size.h chunked_helpers_trie.h diff --git a/library/cpp/containers/disjoint_interval_tree/ut/ya.make b/library/cpp/containers/disjoint_interval_tree/ut/ya.make index b4ccc419176..b06f26bd30c 100644 --- a/library/cpp/containers/disjoint_interval_tree/ut/ya.make +++ b/library/cpp/containers/disjoint_interval_tree/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/containers/disjoint_interval_tree) + SRCS( disjoint_interval_tree_ut.cpp ) diff --git a/library/cpp/containers/disjoint_interval_tree/ya.make b/library/cpp/containers/disjoint_interval_tree/ya.make index 688a415c0fb..61bd04e2ca6 100644 --- a/library/cpp/containers/disjoint_interval_tree/ya.make +++ b/library/cpp/containers/disjoint_interval_tree/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS(disjoint_interval_tree.cpp) diff --git a/library/cpp/containers/paged_vector/ut/ya.make b/library/cpp/containers/paged_vector/ut/ya.make index d0ffac4d79b..d0abb26730b 100644 --- a/library/cpp/containers/paged_vector/ut/ya.make +++ b/library/cpp/containers/paged_vector/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/containers/paged_vector ) diff --git a/library/cpp/containers/paged_vector/ya.make b/library/cpp/containers/paged_vector/ya.make index b03a0a2deda..9cd3571419b 100644 --- a/library/cpp/containers/paged_vector/ya.make +++ b/library/cpp/containers/paged_vector/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( paged_vector.cpp ) diff --git a/library/cpp/containers/ring_buffer/ya.make b/library/cpp/containers/ring_buffer/ya.make index c9220b578ab..7867ea0ffb9 100644 --- a/library/cpp/containers/ring_buffer/ya.make +++ b/library/cpp/containers/ring_buffer/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS( diff --git a/library/cpp/deprecated/accessors/ut/ya.make b/library/cpp/deprecated/accessors/ut/ya.make index 5e79af5efd9..e73ce78c3dc 100644 --- a/library/cpp/deprecated/accessors/ut/ya.make +++ b/library/cpp/deprecated/accessors/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/deprecated/accessors) + SRCS( accessors_ut.cpp ) diff --git a/library/cpp/deprecated/accessors/ya.make b/library/cpp/deprecated/accessors/ya.make index 0aa8fcfa9bd..53f3d785014 100644 --- a/library/cpp/deprecated/accessors/ya.make +++ b/library/cpp/deprecated/accessors/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( accessors.cpp accessors_impl.cpp diff --git a/library/cpp/deprecated/enum_codegen/ya.make b/library/cpp/deprecated/enum_codegen/ya.make index 9ff9997c84d..b720fd75971 100644 --- a/library/cpp/deprecated/enum_codegen/ya.make +++ b/library/cpp/deprecated/enum_codegen/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( enum_codegen.cpp ) diff --git a/library/cpp/deprecated/split/ya.make b/library/cpp/deprecated/split/ya.make index 8b6897fa28f..4a3d21835a6 100644 --- a/library/cpp/deprecated/split/ya.make +++ b/library/cpp/deprecated/split/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( delim_string_iter.cpp split_iterator.cpp diff --git a/library/cpp/diff/ut/ya.make b/library/cpp/diff/ut/ya.make index c0a091aa867..965ba0db681 100644 --- a/library/cpp/diff/ut/ya.make +++ b/library/cpp/diff/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + SRCDIR(library/cpp/diff) PEERDIR( diff --git a/library/cpp/diff/ya.make b/library/cpp/diff/ya.make index c975ced7aa1..57bfbf683b9 100644 --- a/library/cpp/diff/ya.make +++ b/library/cpp/diff/ya.make @@ -1,5 +1,6 @@ LIBRARY() + PEERDIR( library/cpp/lcs library/cpp/containers/stack_array diff --git a/library/cpp/disjoint_sets/ya.make b/library/cpp/disjoint_sets/ya.make index 2104298baa4..5342bfcf4e9 100644 --- a/library/cpp/disjoint_sets/ya.make +++ b/library/cpp/disjoint_sets/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS( diff --git a/library/cpp/dwarf_backtrace/ut/ya.make b/library/cpp/dwarf_backtrace/ut/ya.make index 9f232564839..6f86dd6c923 100644 --- a/library/cpp/dwarf_backtrace/ut/ya.make +++ b/library/cpp/dwarf_backtrace/ut/ya.make @@ -1,3 +1,4 @@ + GTEST() PEERDIR( diff --git a/library/cpp/dwarf_backtrace/ya.make b/library/cpp/dwarf_backtrace/ya.make index e955f9aa92f..6260d3f89a1 100644 --- a/library/cpp/dwarf_backtrace/ya.make +++ b/library/cpp/dwarf_backtrace/ya.make @@ -1,3 +1,4 @@ + LIBRARY() NO_WSHADOW() diff --git a/library/cpp/getopt/last_getopt_demo/ya.make b/library/cpp/getopt/last_getopt_demo/ya.make index bbc01016d63..a25392e26ed 100644 --- a/library/cpp/getopt/last_getopt_demo/ya.make +++ b/library/cpp/getopt/last_getopt_demo/ya.make @@ -1,5 +1,6 @@ PROGRAM(last_getopt_demo) + PEERDIR( library/cpp/getopt ) diff --git a/library/cpp/histogram/adaptive/ya.make b/library/cpp/histogram/adaptive/ya.make index 43d0525b4e5..a787203d755 100644 --- a/library/cpp/histogram/adaptive/ya.make +++ b/library/cpp/histogram/adaptive/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( common.cpp adaptive_histogram.cpp diff --git a/library/cpp/html/entity/ya.make b/library/cpp/html/entity/ya.make index 827e9c6b6dd..bb8a9ec2429 100644 --- a/library/cpp/html/entity/ya.make +++ b/library/cpp/html/entity/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( htmlentity.cpp decoder.rl6 diff --git a/library/cpp/html/escape/ut/ya.make b/library/cpp/html/escape/ut/ya.make index 605e99d2fd3..e3744c5b6f5 100644 --- a/library/cpp/html/escape/ut/ya.make +++ b/library/cpp/html/escape/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + SRCS( escape_ut.cpp ) diff --git a/library/cpp/html/escape/ya.make b/library/cpp/html/escape/ya.make index b5de3c9a77d..5a57686abf3 100644 --- a/library/cpp/html/escape/ya.make +++ b/library/cpp/html/escape/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( escape.cpp ) diff --git a/library/cpp/html/pcdata/ut/ya.make b/library/cpp/html/pcdata/ut/ya.make index 6d7f95627c0..f7ef7e26aeb 100644 --- a/library/cpp/html/pcdata/ut/ya.make +++ b/library/cpp/html/pcdata/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/html/pcdata) + SRCS( pcdata_ut.cpp ) diff --git a/library/cpp/html/pcdata/ya.make b/library/cpp/html/pcdata/ya.make index 2710d6728be..e4cac1892e7 100644 --- a/library/cpp/html/pcdata/ya.make +++ b/library/cpp/html/pcdata/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( pcdata.cpp pcdata.h diff --git a/library/cpp/int128/bench/ya.make b/library/cpp/int128/bench/ya.make index 0dbc45e21ff..14d189c5764 100644 --- a/library/cpp/int128/bench/ya.make +++ b/library/cpp/int128/bench/ya.make @@ -1,3 +1,4 @@ + Y_BENCHMARK() SRCS( diff --git a/library/cpp/int128/ut/ya.make b/library/cpp/int128/ut/ya.make index 22ef97d5662..27b4b4dc884 100644 --- a/library/cpp/int128/ut/ya.make +++ b/library/cpp/int128/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/int128) + SRCS( int128_ut_helpers.cpp int128_ut_helpers.h diff --git a/library/cpp/json/ut/ya.make b/library/cpp/json/ut/ya.make index 1f14dd8f6f0..2ed6ccb9f0b 100644 --- a/library/cpp/json/ut/ya.make +++ b/library/cpp/json/ut/ya.make @@ -1,3 +1,4 @@ + UNITTEST_FOR(library/cpp/json) PEERDIR( diff --git a/library/cpp/json/writer/ut/ya.make b/library/cpp/json/writer/ut/ya.make index 256b950a6e3..18e286e8213 100644 --- a/library/cpp/json/writer/ut/ya.make +++ b/library/cpp/json/writer/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( ADDINCL library/cpp/json/writer ) diff --git a/library/cpp/l1_distance/ya.make b/library/cpp/l1_distance/ya.make index 9345cb99af8..4406d6828ae 100644 --- a/library/cpp/l1_distance/ya.make +++ b/library/cpp/l1_distance/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( l1_distance.h ) diff --git a/library/cpp/l2_distance/ya.make b/library/cpp/l2_distance/ya.make index 919e77ae4a9..5375c34b723 100644 --- a/library/cpp/l2_distance/ya.make +++ b/library/cpp/l2_distance/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( l2_distance.h l2_distance.cpp diff --git a/library/cpp/lcs/ut/ya.make b/library/cpp/lcs/ut/ya.make index e893bc95278..ffc8aa61f3d 100644 --- a/library/cpp/lcs/ut/ya.make +++ b/library/cpp/lcs/ut/ya.make @@ -1,3 +1,4 @@ + UNITTEST() PEERDIR( diff --git a/library/cpp/lcs/ya.make b/library/cpp/lcs/ya.make index 8c63b44e795..1ae7a5c3cd7 100644 --- a/library/cpp/lcs/ya.make +++ b/library/cpp/lcs/ya.make @@ -1,5 +1,6 @@ LIBRARY() + PEERDIR( library/cpp/containers/paged_vector ) diff --git a/library/cpp/lfalloc/dbg/ya.make b/library/cpp/lfalloc/dbg/ya.make index 39f3fb94563..bc14ae2aa60 100644 --- a/library/cpp/lfalloc/dbg/ya.make +++ b/library/cpp/lfalloc/dbg/ya.make @@ -1,5 +1,6 @@ LIBRARY() + ALLOCATOR_IMPL() NO_UTIL() diff --git a/library/cpp/lfalloc/dbg_info/ya.make b/library/cpp/lfalloc/dbg_info/ya.make index 47b7a59f958..ada70f39c12 100644 --- a/library/cpp/lfalloc/dbg_info/ya.make +++ b/library/cpp/lfalloc/dbg_info/ya.make @@ -1,5 +1,6 @@ LIBRARY() + PEERDIR( library/cpp/malloc/api ) diff --git a/library/cpp/lfalloc/ya.make b/library/cpp/lfalloc/ya.make index 6b3b74c7e37..3d632f705d4 100644 --- a/library/cpp/lfalloc/ya.make +++ b/library/cpp/lfalloc/ya.make @@ -1,5 +1,6 @@ LIBRARY() + BUILD_ONLY_IF(WARNING FATAL_ERROR ARCH_TYPE_64) ALLOCATOR_IMPL() diff --git a/library/cpp/linear_regression/benchmark/ya.make b/library/cpp/linear_regression/benchmark/ya.make index 5a2f1ebb5d9..6d3a6be0045 100644 --- a/library/cpp/linear_regression/benchmark/ya.make +++ b/library/cpp/linear_regression/benchmark/ya.make @@ -1,5 +1,6 @@ PROGRAM(linear_regression_benchmark) + SRCS( pool.h pool.cpp diff --git a/library/cpp/linear_regression/ut/ya.make b/library/cpp/linear_regression/ut/ya.make index 18e8e5eff0e..33f40fabad8 100644 --- a/library/cpp/linear_regression/ut/ya.make +++ b/library/cpp/linear_regression/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( ADDINCL library/cpp/linear_regression ) diff --git a/library/cpp/linear_regression/ya.make b/library/cpp/linear_regression/ya.make index 504de7ee6eb..1a763bcceb9 100644 --- a/library/cpp/linear_regression/ya.make +++ b/library/cpp/linear_regression/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( linear_regression.cpp unimodal.cpp diff --git a/library/cpp/logger/global/ut/ya.make b/library/cpp/logger/global/ut/ya.make index df11609b6cf..9c404c4b5d2 100644 --- a/library/cpp/logger/global/ut/ya.make +++ b/library/cpp/logger/global/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/logger/global ) diff --git a/library/cpp/malloc/api/ut/ya.make b/library/cpp/malloc/api/ut/ya.make index 5580da99d73..7b46871fbfc 100644 --- a/library/cpp/malloc/api/ut/ya.make +++ b/library/cpp/malloc/api/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/malloc/api/helpers ) diff --git a/library/cpp/malloc/api/ya.make b/library/cpp/malloc/api/ya.make index 499792ba197..b249c496534 100644 --- a/library/cpp/malloc/api/ya.make +++ b/library/cpp/malloc/api/ya.make @@ -2,6 +2,7 @@ LIBRARY() NO_UTIL() + SRCS( malloc.cpp ) diff --git a/library/cpp/malloc/jemalloc/ya.make b/library/cpp/malloc/jemalloc/ya.make index 035133b0f5d..25c78d73d12 100644 --- a/library/cpp/malloc/jemalloc/ya.make +++ b/library/cpp/malloc/jemalloc/ya.make @@ -3,6 +3,7 @@ LIBRARY() NO_UTIL() ALLOCATOR_IMPL() + IF (OS_ANDROID) PEERDIR( library/cpp/malloc/system diff --git a/library/cpp/malloc/system/ya.make b/library/cpp/malloc/system/ya.make index e8454480c3b..93862fff709 100644 --- a/library/cpp/malloc/system/ya.make +++ b/library/cpp/malloc/system/ya.make @@ -6,6 +6,7 @@ ALLOCATOR_IMPL() NO_UTIL() + PEERDIR( library/cpp/malloc/api ) diff --git a/library/cpp/monlib/dynamic_counters/ut/ya.make b/library/cpp/monlib/dynamic_counters/ut/ya.make index 9c272eaea10..b836e4d4a84 100644 --- a/library/cpp/monlib/dynamic_counters/ut/ya.make +++ b/library/cpp/monlib/dynamic_counters/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/monlib/dynamic_counters) + SRCS( contention_ut.cpp counters_ut.cpp diff --git a/library/cpp/monlib/service/pages/resources/ya.make b/library/cpp/monlib/service/pages/resources/ya.make index 64322df0c07..b68c455b7d2 100644 --- a/library/cpp/monlib/service/pages/resources/ya.make +++ b/library/cpp/monlib/service/pages/resources/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( css_mon_page.h fonts_mon_page.h diff --git a/library/cpp/packers/ut/ya.make b/library/cpp/packers/ut/ya.make index 0aae24a72f3..6b3c2325bbb 100644 --- a/library/cpp/packers/ut/ya.make +++ b/library/cpp/packers/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/packers) + SRCS( packers_ut.cpp proto_packer_ut.cpp diff --git a/library/cpp/packers/ya.make b/library/cpp/packers/ya.make index 87a90c822c5..d35ecd7271d 100644 --- a/library/cpp/packers/ya.make +++ b/library/cpp/packers/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( packers.cpp proto_packer.cpp diff --git a/library/cpp/protobuf/dynamic_prototype/ya.make b/library/cpp/protobuf/dynamic_prototype/ya.make index 3fd883b6a20..ab5727d5d3a 100644 --- a/library/cpp/protobuf/dynamic_prototype/ya.make +++ b/library/cpp/protobuf/dynamic_prototype/ya.make @@ -6,7 +6,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime ) END() diff --git a/library/cpp/protobuf/json/proto/ya.make b/library/cpp/protobuf/json/proto/ya.make index 072afd2d43c..cfe84f5bb68 100644 --- a/library/cpp/protobuf/json/proto/ya.make +++ b/library/cpp/protobuf/json/proto/ya.make @@ -1,5 +1,6 @@ PROTO_LIBRARY() + SRCS( enum_options.proto ) diff --git a/library/cpp/protobuf/json/ya.make b/library/cpp/protobuf/json/ya.make index 9309e341efd..b7b3d27a757 100644 --- a/library/cpp/protobuf/json/ya.make +++ b/library/cpp/protobuf/json/ya.make @@ -14,8 +14,8 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf library/cpp/json + library/cpp/protobuf/runtime library/cpp/protobuf/util library/cpp/protobuf/json/proto library/cpp/string_utils/relaxed_escaper diff --git a/library/cpp/protobuf/runtime/ya.make b/library/cpp/protobuf/runtime/ya.make new file mode 100644 index 00000000000..4ddfe0f8ed8 --- /dev/null +++ b/library/cpp/protobuf/runtime/ya.make @@ -0,0 +1,9 @@ +LIBRARY() + +IF (USE_VANILLA_PROTOC) + PEERDIR(contrib/libs/protobuf_std) +ELSE() + PEERDIR(contrib/libs/protobuf) +ENDIF() + +END() diff --git a/library/cpp/protobuf/util/proto/ya.make b/library/cpp/protobuf/util/proto/ya.make index f3fedf54cd7..f2fa1d0e36c 100644 --- a/library/cpp/protobuf/util/proto/ya.make +++ b/library/cpp/protobuf/util/proto/ya.make @@ -1,5 +1,6 @@ PROTO_LIBRARY() + SRCS( merge.proto ) diff --git a/library/cpp/protobuf/util/ut/ya.make b/library/cpp/protobuf/util/ut/ya.make index 1f321085b1a..ca47bdb00de 100644 --- a/library/cpp/protobuf/util/ut/ya.make +++ b/library/cpp/protobuf/util/ut/ya.make @@ -1,3 +1,4 @@ + UNITTEST_FOR(library/cpp/protobuf/util) SRCS( diff --git a/library/cpp/protobuf/util/ya.make b/library/cpp/protobuf/util/ya.make index 98c6a0306d4..f451b337393 100644 --- a/library/cpp/protobuf/util/ya.make +++ b/library/cpp/protobuf/util/ya.make @@ -1,5 +1,6 @@ LIBRARY() + PEERDIR( contrib/libs/protobuf library/cpp/binsaver diff --git a/library/cpp/protobuf/yql/ya.make b/library/cpp/protobuf/yql/ya.make index 088890befc7..070fd399b6f 100644 --- a/library/cpp/protobuf/yql/ya.make +++ b/library/cpp/protobuf/yql/ya.make @@ -1,14 +1,15 @@ LIBRARY() + SRCS( descriptor.cpp ) PEERDIR( - contrib/libs/protobuf library/cpp/json library/cpp/protobuf/dynamic_prototype library/cpp/protobuf/json + library/cpp/protobuf/runtime library/cpp/string_utils/base64 ) diff --git a/library/cpp/scheme/tests/fuzz_ops/ut/ya.make b/library/cpp/scheme/tests/fuzz_ops/ut/ya.make index 042a1038679..8a46527c003 100644 --- a/library/cpp/scheme/tests/fuzz_ops/ut/ya.make +++ b/library/cpp/scheme/tests/fuzz_ops/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/testing/unittest library/cpp/scheme diff --git a/library/cpp/scheme/tests/ut/ya.make b/library/cpp/scheme/tests/ut/ya.make index ceea46500fc..cadf8364d0a 100644 --- a/library/cpp/scheme/tests/ut/ya.make +++ b/library/cpp/scheme/tests/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/protobuf/util library/cpp/scheme/tests/fuzz_ops/lib diff --git a/library/cpp/scheme/ut_utils/ya.make b/library/cpp/scheme/ut_utils/ya.make index 15200afca3e..02924d4bc29 100644 --- a/library/cpp/scheme/ut_utils/ya.make +++ b/library/cpp/scheme/ut_utils/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( scheme_ut_utils.cpp ) diff --git a/library/cpp/scheme/ya.make b/library/cpp/scheme/ya.make index 2b6c79a2e0e..890b2721235 100644 --- a/library/cpp/scheme/ya.make +++ b/library/cpp/scheme/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( scheme.cpp scheme_cast.h diff --git a/library/cpp/sse/ut/ya.make b/library/cpp/sse/ut/ya.make index bdcbac1d69c..849ea86c210 100644 --- a/library/cpp/sse/ut/ya.make +++ b/library/cpp/sse/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/sse) + SRCS( test.cpp ) diff --git a/library/cpp/string_utils/csv/ya.make b/library/cpp/string_utils/csv/ya.make index 16682d40e56..b259940b5f0 100644 --- a/library/cpp/string_utils/csv/ya.make +++ b/library/cpp/string_utils/csv/ya.make @@ -1,3 +1,4 @@ + LIBRARY() SRCS( diff --git a/library/cpp/string_utils/indent_text/ya.make b/library/cpp/string_utils/indent_text/ya.make index 28a5e77cfe5..19873981d82 100644 --- a/library/cpp/string_utils/indent_text/ya.make +++ b/library/cpp/string_utils/indent_text/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( indent_text.cpp ) diff --git a/library/cpp/string_utils/levenshtein_diff/ut/ya.make b/library/cpp/string_utils/levenshtein_diff/ut/ya.make index 30ff29f97b7..8cf18d53f70 100644 --- a/library/cpp/string_utils/levenshtein_diff/ut/ya.make +++ b/library/cpp/string_utils/levenshtein_diff/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/string_utils/levenshtein_diff) + SRCS( levenshtein_diff_ut.cpp ) diff --git a/library/cpp/string_utils/quote/ut/ya.make b/library/cpp/string_utils/quote/ut/ya.make index ad951b1ed1c..1aea753bc6b 100644 --- a/library/cpp/string_utils/quote/ut/ya.make +++ b/library/cpp/string_utils/quote/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/string_utils/quote) + SRCS( quote_ut.cpp ) diff --git a/library/cpp/string_utils/relaxed_escaper/ut/ya.make b/library/cpp/string_utils/relaxed_escaper/ut/ya.make index d437907e5b4..77d2035b597 100644 --- a/library/cpp/string_utils/relaxed_escaper/ut/ya.make +++ b/library/cpp/string_utils/relaxed_escaper/ut/ya.make @@ -1,5 +1,6 @@ UNITTEST_FOR(library/cpp/string_utils/relaxed_escaper) + SRCS( relaxed_escaper_ut.cpp ) diff --git a/library/cpp/string_utils/relaxed_escaper/ya.make b/library/cpp/string_utils/relaxed_escaper/ya.make index 2f9e92a5785..6de0e81d7b7 100644 --- a/library/cpp/string_utils/relaxed_escaper/ya.make +++ b/library/cpp/string_utils/relaxed_escaper/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( relaxed_escaper.cpp ) diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index c850afa5a73..4db902cf654 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -71,6 +71,40 @@ namespace NUrl { return {host, path}; } + bool HasLowerHost(const TStringBuf &url) { + for (size_t n = 0; n < url.length(); ++n) { + if (url[n] == '/') + break; + if (isupper(url[n])) + return false; + } + return true; + } + + TStringBuf CutHttpWwwPrefixes(const TStringBuf &url) { + TStringBuf urlCut = CutWWWPrefix(CutHttpPrefix(url)); + if (!urlCut.empty() && urlCut.back() == '/') + urlCut = urlCut.substr(0, urlCut.length() - 1); + return urlCut; + } + + TString MakeLowerHost(const TStringBuf &url, size_t shift) { + TString urlFixed(url); + for (char *c = urlFixed.begin() + shift; *c && (*c != '/'); ++c) { + *c = tolower(*c); + } + + return urlFixed; + } + + TString MakeNormalized(const TStringBuf &url) { + TStringBuf urlCut = CutHttpWwwPrefixes(url); + if (HasLowerHost(urlCut)) { + return ToString(urlCut); + } + return MakeLowerHost(urlCut); + } + } // namespace NUrl size_t GetHttpPrefixSize(const char* url, bool ignorehttps) noexcept { diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h index 68fa23d64c8..9b73233078e 100644 --- a/library/cpp/string_utils/url/url.h +++ b/library/cpp/string_utils/url/url.h @@ -21,6 +21,11 @@ namespace NUrl { Y_PURE_FUNCTION TSplitUrlToHostAndPathResult SplitUrlToHostAndPath(const TStringBuf url); + bool HasLowerHost(const TStringBuf &url); + TStringBuf CutHttpWwwPrefixes(const TStringBuf &url); + TString MakeLowerHost(const TStringBuf &url, size_t shift = 0); + TString MakeNormalized(const TStringBuf &url); + } // namespace NUrl Y_PURE_FUNCTION @@ -170,4 +175,3 @@ TStringBuf RemoveFinalSlash(TStringBuf str) noexcept; TStringBuf CutUrlPrefixes(TStringBuf url) noexcept; bool DoesUrlPathStartWithToken(TStringBuf url, const TStringBuf& token) noexcept; - diff --git a/library/cpp/string_utils/ztstrbuf/ya.make b/library/cpp/string_utils/ztstrbuf/ya.make index 019d9e890bb..9d8d3b7110b 100644 --- a/library/cpp/string_utils/ztstrbuf/ya.make +++ b/library/cpp/string_utils/ztstrbuf/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( ztstrbuf.cpp ) diff --git a/library/cpp/tdigest/ya.make b/library/cpp/tdigest/ya.make index 2546443726e..37d4e13a276 100644 --- a/library/cpp/tdigest/ya.make +++ b/library/cpp/tdigest/ya.make @@ -6,7 +6,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime ) END() diff --git a/library/cpp/terminate_handler/sample/exception/ya.make b/library/cpp/terminate_handler/sample/exception/ya.make index c43de8348e0..444cc48c3b0 100644 --- a/library/cpp/terminate_handler/sample/exception/ya.make +++ b/library/cpp/terminate_handler/sample/exception/ya.make @@ -1,5 +1,6 @@ PROGRAM(exception_sample) + SRCS( main.cpp ) diff --git a/library/cpp/terminate_handler/sample/pure-virtual/ya.make b/library/cpp/terminate_handler/sample/pure-virtual/ya.make index ae4a907f402..e7fcbd8f405 100644 --- a/library/cpp/terminate_handler/sample/pure-virtual/ya.make +++ b/library/cpp/terminate_handler/sample/pure-virtual/ya.make @@ -1,5 +1,6 @@ PROGRAM() + SRCS( main.cpp ) diff --git a/library/cpp/terminate_handler/sample/rethrow/ya.make b/library/cpp/terminate_handler/sample/rethrow/ya.make index ae4a907f402..e7fcbd8f405 100644 --- a/library/cpp/terminate_handler/sample/rethrow/ya.make +++ b/library/cpp/terminate_handler/sample/rethrow/ya.make @@ -1,5 +1,6 @@ PROGRAM() + SRCS( main.cpp ) diff --git a/library/cpp/terminate_handler/sample/segv/ya.make b/library/cpp/terminate_handler/sample/segv/ya.make index ae4a907f402..e7fcbd8f405 100644 --- a/library/cpp/terminate_handler/sample/segv/ya.make +++ b/library/cpp/terminate_handler/sample/segv/ya.make @@ -1,5 +1,6 @@ PROGRAM() + SRCS( main.cpp ) diff --git a/library/cpp/testing/gmock_in_unittest/example_ut/ya.make b/library/cpp/testing/gmock_in_unittest/example_ut/ya.make index 38d3aae8117..f96934e7969 100644 --- a/library/cpp/testing/gmock_in_unittest/example_ut/ya.make +++ b/library/cpp/testing/gmock_in_unittest/example_ut/ya.make @@ -1,5 +1,6 @@ UNITTEST() + PEERDIR( library/cpp/testing/gmock_in_unittest ) diff --git a/library/cpp/testing/gmock_in_unittest/ya.make b/library/cpp/testing/gmock_in_unittest/ya.make index cd2fa65b48d..3bca6c3a3a9 100644 --- a/library/cpp/testing/gmock_in_unittest/ya.make +++ b/library/cpp/testing/gmock_in_unittest/ya.make @@ -1,5 +1,6 @@ LIBRARY() + PEERDIR( contrib/restricted/googletest/googlemock contrib/restricted/googletest/googletest diff --git a/library/cpp/testing/gtest/matchers.h b/library/cpp/testing/gtest/matchers.h index 0db0597304e..4c0154e9148 100644 --- a/library/cpp/testing/gtest/matchers.h +++ b/library/cpp/testing/gtest/matchers.h @@ -32,7 +32,7 @@ namespace NGTest { { if (!NDetail::MatchOrUpdateGolden(std::string_view(arg.data(), arg.size()), TString(filename))) { *result_listener - << "\nCall `ya m -rA --test-param GTEST_UPDATE_GOLDEN=1` to update the golden file"; + << "\nCall `ya test --test-param GTEST_UPDATE_GOLDEN=1` to update the golden file"; return false; } return true; diff --git a/library/cpp/threading/future/README.md b/library/cpp/threading/future/README.md new file mode 100644 index 00000000000..9b9929c8228 --- /dev/null +++ b/library/cpp/threading/future/README.md @@ -0,0 +1,2 @@ +See: +https://docs.yandex-team.ru/arcadia-cpp/cookbook/concurrency diff --git a/library/cpp/threading/future/benchmark/coroutine_traits.cpp b/library/cpp/threading/future/benchmark/coroutine_traits.cpp new file mode 100644 index 00000000000..93528bfac06 --- /dev/null +++ b/library/cpp/threading/future/benchmark/coroutine_traits.cpp @@ -0,0 +1,82 @@ +#include <library/cpp/threading/future/future.h> +#include <library/cpp/threading/future/core/coroutine_traits.h> + +#include <benchmark/benchmark.h> + +class TContext { +public: + TContext() + : NextInputPromise_(NThreading::NewPromise<bool>()) + {} + ~TContext() { + UpdateNextInput(false); + } + + NThreading::TFuture<bool> NextInput() { + return NextInputPromise_.GetFuture(); + } + + void UpdateNextInput(bool hasInput = true) { + auto prevNextInputPromise = NextInputPromise_; + NextInputPromise_ = NThreading::NewPromise<bool>(); + prevNextInputPromise.SetValue(hasInput); + } + +private: + NThreading::TPromise<bool> NextInputPromise_; +}; + +static void TestPureFutureChainSubscribe(benchmark::State& state) { + TContext context; + size_t cnt = 0; + std::function<void(const NThreading::TFuture<bool>&)> processInput = [&context, &cnt, &processInput](const NThreading::TFuture<bool>& hasInput) { + if (hasInput.GetValue()) { + benchmark::DoNotOptimize(++cnt); + context.NextInput().Subscribe(processInput); + } + }; + + processInput(NThreading::MakeFuture<bool>(true)); + for (auto _ : state) { + context.UpdateNextInput(); + } + context.UpdateNextInput(false); +} + +static void TestPureFutureChainApply(benchmark::State& state) { + TContext context; + size_t cnt = 0; + std::function<void(const NThreading::TFuture<bool>&)> processInput = [&context, &cnt, &processInput](const NThreading::TFuture<bool>& hasInput) { + if (hasInput.GetValue()) { + benchmark::DoNotOptimize(++cnt); + context.NextInput().Apply(processInput); + } + }; + + processInput(NThreading::MakeFuture<bool>(true)); + for (auto _ : state) { + context.UpdateNextInput(); + } + context.UpdateNextInput(false); +} + +static void TestCoroFutureChain(benchmark::State& state) { + TContext context; + size_t cnt = 0; + auto coroutine = [&context, &cnt]() -> NThreading::TFuture<void> { + while (co_await context.NextInput()) { + benchmark::DoNotOptimize(++cnt); + } + }; + + auto coroutineFuture = coroutine(); + for (auto _ : state) { + context.UpdateNextInput(); + } + context.UpdateNextInput(false); + coroutineFuture.GetValueSync(); +} + +BENCHMARK(TestPureFutureChainSubscribe); +BENCHMARK(TestPureFutureChainApply); +BENCHMARK(TestCoroFutureChain); diff --git a/library/cpp/threading/future/benchmark/ya.make b/library/cpp/threading/future/benchmark/ya.make new file mode 100644 index 00000000000..f71f52acbbe --- /dev/null +++ b/library/cpp/threading/future/benchmark/ya.make @@ -0,0 +1,11 @@ +G_BENCHMARK() + +PEERDIR( + library/cpp/threading/future +) + +SRCS( + coroutine_traits.cpp +) + +END() diff --git a/library/cpp/threading/future/core/coroutine_traits.h b/library/cpp/threading/future/core/coroutine_traits.h new file mode 100644 index 00000000000..5871e22a35d --- /dev/null +++ b/library/cpp/threading/future/core/coroutine_traits.h @@ -0,0 +1,99 @@ +#pragma once + +#include <library/cpp/threading/future/future.h> + +#include <coroutine> + +template<typename... Args> +struct std::coroutine_traits<NThreading::TFuture<void>, Args...> { + struct promise_type { + + NThreading::TFuture<void> get_return_object() { + return Promise_.GetFuture(); + } + + std::suspend_never initial_suspend() { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } + + void unhandled_exception() { + Promise_.SetException(std::current_exception()); + } + + void return_void() { + Promise_.SetValue(); + } + + private: + NThreading::TPromise<void> Promise_ = NThreading::NewPromise(); + }; +}; + +template<typename T, typename... Args> +struct std::coroutine_traits<NThreading::TFuture<T>, Args...> { + struct promise_type { + NThreading::TFuture<T> get_return_object() { + return Promise_.GetFuture(); + } + + std::suspend_never initial_suspend() { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } + + void unhandled_exception() { + Promise_.SetException(std::current_exception()); + } + + void return_value(auto&& val) { + Promise_.SetValue(std::forward<decltype(val)>(val)); + } + + private: + NThreading::TPromise<T> Promise_ = NThreading::NewPromise<T>(); + }; +}; + +template<typename T> +struct TFutureAwaitable { + NThreading::TFuture<T> Future; + + TFutureAwaitable(NThreading::TFuture<T> future) + : Future{future} + { + } + + bool await_ready() const noexcept { + return Future.HasValue() || Future.HasException(); + } + + void await_suspend(auto h) noexcept { + /* + * This library assumes that resume never throws an exception. + * This assumption is made due to the fact that the users of these library in most cases do not need to write their own coroutine handlers, + * and all coroutine handlers provided by the library do not throw exception from resume. + * + * WARNING: do not change subscribe to apply or something other here, creating an extra future state degrades performance. + */ + Future.NoexceptSubscribe( + [h](auto) mutable noexcept { + h(); + } + ); + } + + decltype(auto) await_resume() { + return Future.GetValue(); + } +}; + +template<typename T> +auto operator co_await(const NThreading::TFuture<T>& future) { + return TFutureAwaitable{future}; +} + +namespace NThreading { + + template<typename T> + auto AsAwaitable(const NThreading::TFuture<T>& fut) { + return operator co_await(fut); + } + +} // namespace NThreading diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index df6b7c21b2f..142ea925671 100644 --- a/library/cpp/threading/future/core/future-inl.h +++ b/library/cpp/threading/future/core/future-inl.h @@ -116,6 +116,9 @@ namespace NThreading { bool HasException() const { return AtomicGet(State) == ExceptionSet; } + bool IsReady() const { + return AtomicGet(State) != NotReady; + } const T& GetValue(TDuration timeout = TDuration::Zero()) const { AccessValue(timeout, ValueRead); @@ -297,6 +300,9 @@ namespace NThreading { bool HasException() const { return AtomicGet(State) == ExceptionSet; } + bool IsReady() const { + return AtomicGet(State) != NotReady; + } void GetValue(TDuration timeout = TDuration::Zero()) const { TAtomicBase state = AtomicGet(State); @@ -583,6 +589,10 @@ namespace NThreading { inline bool TFuture<T>::HasException() const { return State && State->HasException(); } + template <typename T> + inline bool TFuture<T>::IsReady() const { + return State && State->IsReady(); + } template <typename T> inline void TFuture<T>::Wait() const { @@ -688,6 +698,9 @@ namespace NThreading { inline bool TFuture<void>::HasException() const { return State && State->HasException(); } + inline bool TFuture<void>::IsReady() const { + return State && State->IsReady(); + } inline void TFuture<void>::Wait() const { EnsureInitialized(); @@ -824,6 +837,11 @@ namespace NThreading { } template <typename T> + inline bool TPromise<T>::IsReady() const { + return State && State->IsReady(); + } + + template <typename T> inline void TPromise<T>::SetException(const TString& e) { EnsureInitialized(); State->SetException(std::make_exception_ptr(yexception() << e)); @@ -904,6 +922,10 @@ namespace NThreading { return State && State->HasException(); } + inline bool TPromise<void>::IsReady() const { + return State && State->IsReady(); + } + inline void TPromise<void>::SetException(const TString& e) { EnsureInitialized(); State->SetException(std::make_exception_ptr(yexception() << e)); diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index 598336282a0..1e76a04d3f1 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -98,6 +98,12 @@ namespace NThreading { void TryRethrow() const; bool HasException() const; + // returns true if exception or value was set. + // allows to check readiness without locking cheker-thread + // NOTE: returns true even if value was extracted from promise + // good replace for HasValue() || HasException() + bool IsReady() const; + void Wait() const; bool Wait(TDuration timeout) const; bool Wait(TInstant deadline) const; @@ -153,6 +159,11 @@ namespace NThreading { void TryRethrow() const; bool HasException() const; + // returns true if exception or value was set. + // allows to check readiness without locking cheker-thread + // good replace for HasValue() || HasException() + bool IsReady() const; + void Wait() const; bool Wait(TDuration timeout) const; bool Wait(TInstant deadline) const; @@ -216,6 +227,12 @@ namespace NThreading { void TryRethrow() const; bool HasException() const; + + // returns true if exception or value was set. + // allows to check readiness without locking cheker-thread + // NOTE: returns true even if value was extracted from promise + // good replace for HasValue() || HasException() + bool IsReady() const; void SetException(const TString& e); void SetException(std::exception_ptr e); bool TrySetException(std::exception_ptr e); @@ -256,6 +273,11 @@ namespace NThreading { void TryRethrow() const; bool HasException() const; + + // returns true if exception or value was set. + // allows to check readiness without locking cheker-thread + // good replace for HasValue() || HasException() + bool IsReady() const; void SetException(const TString& e); void SetException(std::exception_ptr e); bool TrySetException(std::exception_ptr e); diff --git a/library/cpp/threading/future/future_ut.cpp b/library/cpp/threading/future/future_ut.cpp index 26f8fa9e9c3..ceb07cae934 100644 --- a/library/cpp/threading/future/future_ut.cpp +++ b/library/cpp/threading/future/future_ut.cpp @@ -105,6 +105,7 @@ namespace { future = MakeFuture(345); UNIT_ASSERT(future.HasValue()); + UNIT_ASSERT(future.IsReady()); UNIT_ASSERT_EQUAL(future.GetValue(), 345); } @@ -115,6 +116,7 @@ namespace { TFuture<void> future = promise.GetFuture(); UNIT_ASSERT(future.HasValue()); + UNIT_ASSERT(future.IsReady()); future = MakeFuture(); UNIT_ASSERT(future.HasValue()); @@ -523,6 +525,7 @@ namespace { { auto future1 = MakeErrorFuture<void>(std::make_exception_ptr(TFutureException())); UNIT_ASSERT(future1.HasException()); + UNIT_ASSERT(future1.IsReady()); UNIT_CHECK_GENERATED_EXCEPTION(future1.GetValue(), TFutureException); auto future2 = MakeErrorFuture<int>(std::make_exception_ptr(TFutureException())); @@ -563,6 +566,7 @@ namespace { promise2.SetException("foo-exception"); wait.Wait(); UNIT_ASSERT(future2.HasException()); + UNIT_ASSERT(!future1.IsReady()); UNIT_ASSERT(!future1.HasValue() && !future1.HasException()); } diff --git a/library/cpp/threading/future/ya.make b/library/cpp/threading/future/ya.make index bc52ca5c180..1d98569906c 100644 --- a/library/cpp/threading/future/ya.make +++ b/library/cpp/threading/future/ya.make @@ -15,6 +15,7 @@ SRCS( END() RECURSE( + benchmark mt_ut perf ut diff --git a/library/cpp/threading/hot_swap/ya.make b/library/cpp/threading/hot_swap/ya.make index 82eb6490a4a..73cc1694117 100644 --- a/library/cpp/threading/hot_swap/ya.make +++ b/library/cpp/threading/hot_swap/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( hot_swap.cpp ) diff --git a/library/cpp/threading/poor_man_openmp/ya.make b/library/cpp/threading/poor_man_openmp/ya.make index 976b2b6b3c3..5d2d1317c54 100644 --- a/library/cpp/threading/poor_man_openmp/ya.make +++ b/library/cpp/threading/poor_man_openmp/ya.make @@ -1,5 +1,6 @@ LIBRARY() + SRCS( thread_helper.cpp ) diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt index fcf3c4ec29d..b20e2da24db 100644 --- a/library/cpp/tld/tlds-alpha-by-domain.txt +++ b/library/cpp/tld/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2024071000, Last Updated Wed Jul 10 07:07:01 2024 UTC +# Version 2024072500, Last Updated Thu Jul 25 07:07:01 2024 UTC AAA AARP ABB diff --git a/library/cpp/yt/memory/range.h b/library/cpp/yt/memory/range.h index 10f2ea43ec2..7a9c0bcd790 100644 --- a/library/cpp/yt/memory/range.h +++ b/library/cpp/yt/memory/range.h @@ -87,7 +87,7 @@ public: //! Constructs a TRange from an std::vector. template <class A> TRange(const std::vector<T, A>& elements) - : Data_(elements.empty() ? nullptr : elements.data()) + : Data_(elements.data()) , Length_(elements.size()) { } |