Skip to content

Commit 389847d

Browse files
committed
Merge pull request #14977 from ydb-platform/merge-libs-250225-0058
2 parents dbce07e + bd8a21a commit 389847d

File tree

161 files changed

+8015
-2633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+8015
-2633
lines changed

build/plugins/_dart_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def cpp_configs(cls, unit, flat_args, spec_args):
670670
class LintExtraParams:
671671
KEY = 'LINT-EXTRA-PARAMS'
672672

673-
_CUSTOM_CLANG_FORMAT_BIN_ALLOWED_PATHS = consts.CUSTOM_CLANG_FORMAT_YT_ALLOWED_PATHS
673+
_CUSTOM_CLANG_FORMAT_BIN_ALLOWED_PATHS = ('ads', 'bigrt', 'grut')
674674

675675
@classmethod
676676
def from_macro_args(cls, unit, flat_args, spec_args):

build/plugins/lib/test_const/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ class DefaultLinterConfig(Enum):
476476
'build/internal/conf/autoincludes.json',
477477
)
478478

479-
CUSTOM_CLANG_FORMAT_YT_ALLOWED_PATHS = ('ads', 'bigrt', 'grut')
480-
481479

482480
class Status(object):
483481
GOOD, XFAIL, FAIL, XPASS, MISSING, CRASHED, TIMEOUT = range(1, 8)

build/sysincl/darwin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
- util.h
177177
- uuid/uuid.h
178178
- vis.h
179+
- xpc/connection.h
179180
- xpc/xpc.h
180181

181182
# OSX frameworks

contrib/libs/cxxsupp/libcxxmsvc/include/initializer_list

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
4747

4848
#if defined(_LIBCPP_COMPILER_MSVC) && !defined(__clang__)
4949

50-
// save __cpp_lib_concepts because it can be redefined inside MSVC standard headers
50+
// save __cpp_lib_concepts and __cpp_lib_ranges because they can be redefined inside MSVC standard headers
5151
#pragma push_macro("__cpp_lib_concepts")
52+
#pragma push_macro("__cpp_lib_ranges")
5253

5354
#include Y_MSVC_INCLUDE_NEXT(yvals.h)
5455

5556
#pragma pop_macro("__cpp_lib_concepts")
57+
#pragma pop_macro("__cpp_lib_ranges")
5658

5759
#include Y_MSVC_INCLUDE_NEXT(initializer_list)
5860

contrib/libs/cxxsupp/libcxxrt/cxxabi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#ifndef __CXXABI_H_
2424
#define __CXXABI_H_
25+
#include <stddef.h>
2526
#include <stdint.h>
2627
#include "unwind.h"
2728
namespace std

contrib/libs/cxxsupp/libcxxrt/exception.cc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -287,31 +287,6 @@ namespace std
287287

288288
using namespace ABI_NAMESPACE;
289289

290-
/**
291-
* Callback function used with _Unwind_Backtrace().
292-
*
293-
* Prints a stack trace. Used only for debugging help.
294-
*
295-
* Note: As of FreeBSD 8.1, dladd() still doesn't work properly, so this only
296-
* correctly prints function names from public, relocatable, symbols.
297-
*/
298-
static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c)
299-
{
300-
Dl_info myinfo;
301-
int mylookup =
302-
dladdr(reinterpret_cast<void *>(__cxa_current_exception_type), &myinfo);
303-
void *ip = reinterpret_cast<void*>(_Unwind_GetIP(context));
304-
Dl_info info;
305-
if (dladdr(ip, &info) != 0)
306-
{
307-
if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0)
308-
{
309-
printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname);
310-
}
311-
}
312-
return _URC_CONTINUE_UNWIND;
313-
}
314-
315290
static void bt_terminate_handler() {
316291
__cxa_eh_globals* globals = __cxa_get_globals();
317292
__cxa_exception* thrown_exception = globals->caughtExceptions;
@@ -784,6 +759,31 @@ void __cxa_free_dependent_exception(void *thrown_exception)
784759
free_exception(reinterpret_cast<char*>(thrown_exception) - dependent_exception_size - backtrace_buffer_size);
785760
}
786761

762+
/**
763+
* Callback function used with _Unwind_Backtrace().
764+
*
765+
* Prints a stack trace. Used only for debugging help.
766+
*
767+
* Note: As of FreeBSD 8.1, dladd() still doesn't work properly, so this only
768+
* correctly prints function names from public, relocatable, symbols.
769+
*/
770+
static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c)
771+
{
772+
Dl_info myinfo;
773+
int mylookup =
774+
dladdr(reinterpret_cast<void *>(__cxa_current_exception_type), &myinfo);
775+
void *ip = reinterpret_cast<void*>(_Unwind_GetIP(context));
776+
Dl_info info;
777+
if (dladdr(ip, &info) != 0)
778+
{
779+
if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0)
780+
{
781+
printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname);
782+
}
783+
}
784+
return _URC_CONTINUE_UNWIND;
785+
}
786+
787787
/**
788788
* Report a failure that occurred when attempting to throw an exception.
789789
*

contrib/libs/cxxsupp/libcxxrt/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by devtools/yamaker from nixpkgs 22.11.
1+
# Generated by devtools/yamaker from nixpkgs 24.05.
22

33
LIBRARY()
44

library/python/monlib/metric.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ cdef extern from "library/cpp/monlib/metrics/metric.h" namespace "NMonitoring" n
4848
cdef cppclass TCounter:
4949
TCounter(ui64 value) except +
5050

51-
void Set(ui64)
5251
ui64 Get() const
53-
void Inc()
52+
ui64 Add(ui64)
53+
ui64 Inc()
5454
void Reset()
5555

5656
cdef cppclass TRate:

library/python/monlib/metric.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ cdef class Counter:
103103
"""
104104
return self.__wrapped.Inc()
105105

106+
def add(self, i64 value):
107+
"""
108+
Add value to metric
109+
"""
110+
return self.__wrapped.Add(value)
111+
106112
def reset(self):
107113
"""
108114
Reset metric value to zero

library/python/monlib/ut/py2/test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ def test_gauge_sensors():
252252
assert ig.get() == 5
253253

254254

255+
def test_counter():
256+
registry = MetricRegistry()
257+
c = registry.counter({'a': 'b'})
258+
259+
assert c.inc() == 1
260+
assert c.add(2) == 3
261+
c.reset()
262+
assert c.get() == 0
263+
264+
255265
UNISTAT_DATA = """[
256266
["signal1_max", 10],
257267
["signal2_hgram", [[0, 100], [50, 200], [200, 300]]],

library/python/monlib/ut/py3/test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ def test_gauge_sensors():
250250
assert ig.get() == 5
251251

252252

253+
def test_counter():
254+
registry = MetricRegistry()
255+
c = registry.counter({'a': 'b'})
256+
257+
assert c.inc() == 1
258+
assert c.add(2) == 3
259+
c.reset()
260+
assert c.get() == 0
261+
262+
253263
UNISTAT_DATA = """[
254264
["signal1_max", 10],
255265
["signal2_hgram", [[0, 100], [50, 200], [200, 300]]],

util/datetime/benchmark/gmtime_r/main.cpp

Lines changed: 69 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,84 @@
33
#include <util/datetime/base.h>
44
#include <util/random/fast.h>
55

6-
void BM_GmTimeR(benchmark::State& state) {
7-
time_t now = TInstant::Now().TimeT();
8-
struct tm buf {};
6+
using TRandomEngine = TFastRng<ui64>;
97

10-
for (auto _ : state) {
11-
Y_DO_NOT_OPTIMIZE_AWAY(GmTimeR(&now, &buf));
12-
}
13-
}
8+
namespace {
149

15-
void BM_gmtime_r(benchmark::State& state) {
16-
time_t now = TInstant::Now().TimeT();
17-
struct tm buf {};
10+
class TTimeRange {
11+
public:
12+
TTimeRange(TInstant base, TDuration spread)
13+
: TTimeRange(base.Seconds(), spread.Seconds())
14+
{
15+
}
1816

19-
for (auto _ : state) {
20-
Y_DO_NOT_OPTIMIZE_AWAY(gmtime_r(&now, &buf));
21-
}
22-
}
17+
TTimeRange(time_t base, time_t spread)
18+
: Base_(base)
19+
, Spread_(spread)
20+
{
21+
Y_ASSERT(Spread_ >= 0);
22+
}
2323

24-
void BM_GmTimeRRandom(benchmark::State& state, TDuration window) {
25-
time_t now = TInstant::Now().TimeT();
26-
struct tm buf {};
24+
time_t Next(TRandomEngine& gen) const {
25+
if (Spread_ <= 1) {
26+
return Base_;
27+
}
28+
time_t offset = gen.GenRand() % Spread_;
29+
return Base_ + offset;
30+
}
2731

28-
TFastRng<ui32> rng(2);
29-
const size_t range = window.Seconds();
30-
for (auto _ : state) {
31-
size_t offset = rng.GenRand() % range;
32-
time_t v = now - offset;
33-
Y_DO_NOT_OPTIMIZE_AWAY(GmTimeR(&v, &buf));
32+
private:
33+
time_t Base_;
34+
time_t Spread_;
35+
};
36+
37+
// change base date after `BATCH_SIZE` iterations to reduce the effect of changing the benchmark's speed depending on the day it was launched
38+
const TDuration FOUR_YEARS = TDuration::Days(1461); // the interval length should be at least four years so that the probability of choosing a leap day/year is not greatly skewed
39+
const TTimeRange BASE_TIME{TInstant::Now(), FOUR_YEARS};
40+
const size_t BATCH_SIZE = 5'000;
41+
42+
} // namespace
43+
44+
void BM_GmTimeR(benchmark::State& state, TDuration window) {
45+
struct tm buf {};
46+
TRandomEngine rng(2);
47+
const time_t range = window.Seconds();
48+
while (state.KeepRunningBatch(BATCH_SIZE)) {
49+
const TTimeRange time{BASE_TIME.Next(rng) - range, range};
50+
for (size_t i = 0; i < BATCH_SIZE; ++i) {
51+
time_t v = time.Next(rng);
52+
Y_DO_NOT_OPTIMIZE_AWAY(GmTimeR(&v, &buf));
53+
}
3454
}
3555
}
3656

37-
void BM_gmtime_r_Random(benchmark::State& state, TDuration window) {
38-
time_t now = TInstant::Now().TimeT();
57+
void BM_gmtime_r(benchmark::State& state, TDuration window) {
3958
struct tm buf {};
40-
41-
TFastRng<ui32> rng(2);
42-
const size_t range = window.Seconds();
43-
for (auto _ : state) {
44-
size_t offset = rng.GenRand() % range;
45-
time_t v = now - offset;
46-
Y_DO_NOT_OPTIMIZE_AWAY(gmtime_r(&v, &buf));
59+
TRandomEngine rng(2);
60+
const time_t range = window.Seconds();
61+
while (state.KeepRunningBatch(BATCH_SIZE)) {
62+
const TTimeRange time{BASE_TIME.Next(rng) - range, range};
63+
for (size_t i = 0; i < BATCH_SIZE; ++i) {
64+
time_t v = time.Next(rng);
65+
Y_DO_NOT_OPTIMIZE_AWAY(gmtime_r(&v, &buf));
66+
}
4767
}
4868
}
4969

50-
BENCHMARK(BM_GmTimeR);
51-
BENCHMARK(BM_gmtime_r);
52-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_hour, TDuration::Hours(1));
53-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_hour, TDuration::Hours(1));
54-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_day, TDuration::Days(1));
55-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_day, TDuration::Days(1));
56-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_month, TDuration::Days(31));
57-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_month, TDuration::Days(31));
58-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_year, TDuration::Days(365));
59-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_year, TDuration::Days(365));
60-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_decade, TDuration::Days(3653));
61-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_decade, TDuration::Days(3653));
62-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_half_century, TDuration::Days(18262));
63-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_half_century, TDuration::Days(18262));
64-
BENCHMARK_CAPTURE(BM_GmTimeRRandom, last_century, TDuration::Days(36525));
65-
BENCHMARK_CAPTURE(BM_gmtime_r_Random, last_century, TDuration::Days(36525));
70+
BENCHMARK_CAPTURE(BM_GmTimeR, now, TDuration::Seconds(0));
71+
BENCHMARK_CAPTURE(BM_GmTimeR, last_hour, TDuration::Hours(1));
72+
BENCHMARK_CAPTURE(BM_GmTimeR, last_day, TDuration::Days(1));
73+
BENCHMARK_CAPTURE(BM_GmTimeR, last_month, TDuration::Days(31));
74+
BENCHMARK_CAPTURE(BM_GmTimeR, last_year, TDuration::Days(365));
75+
BENCHMARK_CAPTURE(BM_GmTimeR, last_decade, TDuration::Days(3653));
76+
BENCHMARK_CAPTURE(BM_GmTimeR, last_half_century, TDuration::Days(18262));
77+
BENCHMARK_CAPTURE(BM_GmTimeR, last_century, TDuration::Days(36525));
78+
79+
BENCHMARK_CAPTURE(BM_gmtime_r, now, TDuration::Seconds(0));
80+
BENCHMARK_CAPTURE(BM_gmtime_r, last_hour, TDuration::Hours(1));
81+
BENCHMARK_CAPTURE(BM_gmtime_r, last_day, TDuration::Days(1));
82+
BENCHMARK_CAPTURE(BM_gmtime_r, last_month, TDuration::Days(31));
83+
BENCHMARK_CAPTURE(BM_gmtime_r, last_year, TDuration::Days(365));
84+
BENCHMARK_CAPTURE(BM_gmtime_r, last_decade, TDuration::Days(3653));
85+
BENCHMARK_CAPTURE(BM_gmtime_r, last_half_century, TDuration::Days(18262));
86+
BENCHMARK_CAPTURE(BM_gmtime_r, last_century, TDuration::Days(36525));

vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/init.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/init_opaque.go

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)