summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* Fix grammar in "yexception.h"r-andrey2023-01-281-6/+6
|
* TMemoryInput Try to prohibit use-after-free and require explicit cast to ↵ilnurkh2023-01-231-0/+6
| | | | TStringBuf (with &&)
* External build system generator release 8robot-ya-builder2023-01-1712-12/+12
| | | Update tools: yexport
* charset: do not allow surrogate pairs in UTF-8dpotapov2023-01-162-14/+114
| | | | | | | | | | | | | | | | | | | By [RFC3629 section 3](https://datatracker.ietf.org/doc/html/rfc3629#section-3): ``` The definition of UTF-8 prohibits encoding character numbers between U+D800 and U+DFFF, which are reserved for use with the UTF-16 encoding form (as surrogate pairs) and do not directly represent characters. ``` Current implementation of `ReadUTF8CharAndAdvance` allows `UTF-8` encoded surrogate characters like 0xED 0xA0 0xBD or 0xED 0xB3 0x9A leaving them in the strings that cannot be processed afterwards by external programs like `iconv`. This patch provides `strict` template flag that disables this leniency. This flag is not enabled by default, because Arcadia already has hundreds of tests with inputs containing such surrogate pairs and these tests breaks in strict mode and there is a chance that prod might affected too. SSE4 implementation doesn't perform any validation at all, so it is left unchanged.
* TSharedPtr::As()&: leakage fixsv-denisov2023-01-142-6/+59
| | | | | | По следам https://a.yandex-team.ru/review/2996409/details Исправлены случаи при неудачных кастах: 1. контрольный блок дёргается даже при указании на nullptr (нехорошо для атомиков) 2. если исходный шаред поинтер разрушится раньше, чем полученный nullptr (например, при возврате из функции), то ресурс утечёт
* introduce NumberOfMillicores() function based on refactored CgroupCpus() ↵svkrasnov2023-01-122-5/+29
| | | | returning double value
* add windows platform to ydb github exportalexv-smirnov2022-12-207-0/+1194
|
* Sync linux-headers instead of using system onesthegeorg2022-12-158-14/+79
|
* remove kikimr/driver DEPENDSqrort2022-12-021-126/+0
|
* validate canons without yatest_commonqrort2022-11-301-0/+126
|
* more information in TEpollPoller::SetImpl error messageskulikov2022-11-142-2/+17
| | | | - don't hide epoll_ctl add errors; - print "fd" and "what" args.
* [util] Terminate instead of deadlock after fork with running thread poolssskvor2022-11-101-4/+8
| | | | | Контекст. В древнем странном коде обнаружили, что если создавать `TThreadPool` часто и конкуретно с запуском `TShellCommand`, то иногда последняя дедлочится: если начали выполнять конструктор `TThreadPool` и регистрацию в `TAtforkQueueRestarter`, захватив `TAtforkQueueRestarter::ActionMutex`, а в другом потоке параллельно сделали `fork`, то последний может форкнуться с залоченым мьютексом. Первым делом происходит вызов коллбеков из `pthread_atfork`, где мьютекс лочится заново. Конечно, форкаться в сложных программах с тредпулами категорически запрещено, но, подозреваю, много кода в аркадии так написано. Давайте как-то защитимся от такого.
* Add comment about necessary nanny settingsskorodumov-s2022-11-021-0/+5
|
* Correct debug trap for M1somov2022-10-301-0/+4
|
* Remove a workaround for ancient CUDA versionsdfyz2022-10-291-7/+0
| | | `#define noexcept throw()` is a questionable idea, since replacing `noexcept` with `throw()` in expressions such as `noexcept(true)` results in spectacular compiler errors. We stopped supporting CUDA 8 (and even CUDA 9) long ago, which means we can just get rid of the problematic define.
* fix coveriy issue 16907: Uninitialized pointer fielduzhas2022-10-281-0/+1
|
* Enable linux-arm platform.dcherednik2022-10-267-22/+458
|
* [util]TLazyValue: remove operator bool and Definedtldr2022-10-112-15/+11
|
* Fix a warning when compiling util/ with nvcc 10.xdfyz2022-10-081-1/+1
| | | | | | | | | | | | nvcc10.1 is unable to compile `[[clang::reinitializes]]` and issues warning as follows: ``` util/generic/ptr.h(194): warning: attribute namespace "clang" is unrecognized util/generic/ptr.h(201): warning: attribute namespace "clang" is unrecognized [...] ``` nvcc11 compiles this code without any warnings. This PRs disable `[[clang::reinitialized]]` when compiling with nvcc10.
* [util] Fix TFunctionRef under MSVCsskvor2022-10-073-6/+23
|
* util: add .As<T> to TSharedPtrionagamed2022-10-012-1/+76
|
* Clang14: Fix library/cpp/coroutine/engine under tsanpg2022-09-291-1/+3
|
* External build system generator release 10robot-ya-builder2022-09-261-1/+1
| | | Update tools: yexport
* add comment for TAdaptiveLocktobo2022-09-221-0/+8
| | | https://clubs.at.yandex-team.ru/arcadia/8450/8489#reply-arcadia-8489
* Fix tsan warnings in yt intrusive ptrayles2022-09-191-0/+21
| | | | | | | | | | | | | | | | | | | | | For example, https://github.com/google/sanitizers/issues/1352 - tsan is not working well with std::atomic_thread_fence Minimal reproducible example (and one that bothers most in every fiber-aware service): ``` auto threadPool = NYT::New<NYT::NConcurrency::TThreadPool>(2, "thread"); TVector<NYT::TFuture<void>> futures; for (size_t i = 0; i < 100000; ++i) { futures.emplace_back(BIND([]() { }).AsyncVia(threadPool->GetInvoker()).Run()); } for (auto& future : futures) { future.Get().ThrowOnError(); } ```
* split hash.h into hash.h and multi_hash_map.htobo2022-09-151-1/+1
|
* prepare to split hash.h into hash_table.h hash.h and multi_hash_map.htobo2022-09-0912-1756/+1775
|
* Fix GC in kv tablet,kruall2022-09-061-3/+4
|
* External build system generator release 7robot-ya-builder2022-09-061-1/+1
|
* Fix incorrect fqdn on linux in some edge casessnaury2022-09-021-9/+28
|
* Update external build system generation utilityrobot-ya-builder2022-09-013-0/+11
| | | | * [cmake] Hierarchical add_subdirectroy structure * [cmake] Support for same file compilation multiple times with different flags
* New cmake semantics for compiling with AVX and other specific flagsignat2022-08-311-11/+0
|
* fixup size of aligned memory region to mlock []yurial2022-08-301-2/+17
| | | Если мы сдвигаем addr в меньшую сторону, то len мы должны увеличить на столько же. В противном случае, мы можем залочить меньше, чем нужно.
* [util] Do not build function_ref on MSVC temporarilysskvor2022-08-262-2/+2
|
* [http/client] Support unix domain sockets as a backendivanzhukov2022-08-264-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | Предыдущий заход: https://a.yandex-team.ru/review/2811077/details#comment--4489184 После изменений можно будет обращаться к HTTP серверу, слушающему на unix domain socket. Пример такого сервера: ```js require('http').createServer((req, res) => { console.log(req); res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify({ 'metrics': [ { 'labels': { 'name': 'metric', 'some_key': 'some_value' }, 'type': 'GAUGE', 'value': 123 } ] }, null, 4)); }) .listen('/home/ivanzhukov/test_ua/ua.sock'); // вместо .listen(7777); ```
* [util] Fix: add missing .cpp for function_refsskvor2022-08-253-0/+3
|
* speedup GmTimeR functiontobo2022-08-252-34/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | в профиле перфа Маркетного репорта постоянно вижу GmTimeR там в цикле вычитается по количеству дней в году и прибавляется по 1 году с 1970 по 2022 на каждый вызов В Маркете проблема стреляла и раньше в последней итерации функция становится на ~~30% быстрее системной gmtime_r %% ----------- GmTimeR --------------- samples: 20691 iterations: 264304536 iterations hr: 264M run time: 5.002055225 per iteration: 39.85866484 cycles ----------- gmtime_r --------------- samples: 17452 iterations: 188034528 iterations hr: 188M run time: 5.001259884 per iteration: 56.96146577 cycles %% текущая верся почти в 2 раза медленнее системной: %% ----------- GmTimeR --------------- samples: 12760 iterations: 100514931 iterations hr: 101M run time: 5.00096133 per iteration: 105.4334174 cycles ----------- gmtime_r --------------- samples: 17667 iterations: 192697896 iterations hr: 193M run time: 5.001356603 per iteration: 55.69031415 cycles %%
* added limit parameterbbiff2022-08-242-0/+272
|
* [util] Add specializations for const / ref qualified member functionssskvor2022-08-243-10/+115
|
* Do not override contains() method which is present is STLthegeorg2022-08-232-18/+0
|
* Switch TString and TStringBase to std::reverse_iteratorthegeorg2022-08-213-56/+9
| | | At the time an attempt to use e. g. `std::find_if` with `TString::rbegin()` / `TString::rend()` does not compile against `-DUSE_STL_SYSTEM` / modern libstdc++.
* fix UB in case of empty stringbufasorotsky2022-08-121-1/+5
|
* Introduce TryFromString returning TMaybeevelkin2022-08-092-2/+59
| | | | | | | | | | | Позволяем писать без неиницилизированных переменных по месту использования. Вот такую красоту например: ``` if (auto a = TryFromString<T>(str)) { что-то делаем с \*a } ```
* Mark clear and reset methods as reinitializing the object.halyavin2022-08-057-34/+47
| | | | | This means, that moved-from object can be safely used after the call of such method. This attribute is used by clang-tidy which checks that moved-from objects are not used unless a reinitialization method is called first.
* add [[nodiscard]] attribute to Strip functionstobo2022-08-041-12/+10
|
* TString -> std::string fix TFsPath copyxinull2022-08-013-1/+58
| | | | | Add copy operator and constructor Create copy with initialized split test
* Print escaped path if it contains invalid characterscezarnik2022-07-281-1/+2
|
* remove unused includetobo2022-07-271-1/+0
|
* add functions without overflowyegorskii2022-07-263-0/+31
|
* [util] prefer non-const begin/end method for non-const containers in ↵swarmer2022-07-192-3/+23
| | | | | | | | | | AdjacentFind* functions AdjacentFind и AdjacentFindBy принимали контейнер по константной ссылке и из-за этого возвращали константный итератор. Стоит для некостантного контейнера возвращать также неконстантный итератор (если он есть). Это позволит 1. использовать итератор для модификации контейнера; 2. обойти проблему, когда методы `end()` и `cend()`/`std::as_const(…).end()` возвращают итераторы разных типов, которые нельзя сравнивать, либо для которых выбор оператора сравнения неоднозначен.