diff options
author | hiddenpath <hiddenpath@yandex-team.com> | 2022-08-11 13:11:49 +0300 |
---|---|---|
committer | hiddenpath <hiddenpath@yandex-team.com> | 2022-08-11 13:11:49 +0300 |
commit | 187335a0df454fa6911d15a6d9a1145a518d4433 (patch) | |
tree | 60c007ee8bfeb667699f5f04ac0190534724d751 /contrib/restricted/abseil-cpp-tstring/y_absl | |
parent | 72f26ccd0c29abc9c55999e49eb091d907cc4788 (diff) | |
download | ydb-187335a0df454fa6911d15a6d9a1145a518d4433.tar.gz |
Enlarge the hierarchy of Abseil-cpp lib
Enlarged the hierarchy of abseil-cpp library
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl')
54 files changed, 1194 insertions, 931 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.txt deleted file mode 100644 index 8fee7e21b4..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(abseil-cpp-tstring-y_absl-algorithm INTERFACE) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.txt index 26bf1b68a8..f8ac36e9bd 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/CMakeLists.txt @@ -7,24 +7,28 @@ -add_library(yabseil-cpp-tstring-y_absl-base) -target_compile_options(yabseil-cpp-tstring-y_absl-base PRIVATE +add_library(abseil-cpp-tstring-y_absl-base) +target_compile_options(abseil-cpp-tstring-y_absl-base PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-base PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-base PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-base PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-base PUBLIC contrib-libs-cxxsupp yutil - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity ) -target_sources(yabseil-cpp-tstring-y_absl-base PRIVATE +target_sources(abseil-cpp-tstring-y_absl-base PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc/CMakeLists.txt deleted file mode 100644 index 7572dfe88a..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ybase-internal-low_level_alloc) -target_compile_options(ybase-internal-low_level_alloc PRIVATE - -Wno-everything -) -target_include_directories(ybase-internal-low_level_alloc PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ybase-internal-low_level_alloc PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity -) -target_sources(ybase-internal-low_level_alloc PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging/CMakeLists.txt deleted file mode 100644 index 22c52adc4d..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ybase-internal-raw_logging) -target_compile_options(ybase-internal-raw_logging PRIVATE - -Wno-everything -) -target_include_directories(ybase-internal-raw_logging PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ybase-internal-raw_logging PUBLIC - contrib-libs-cxxsupp - yutil - yabsl-base-log_severity -) -target_sources(ybase-internal-raw_logging PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc new file mode 100644 index 0000000000..ad48ddbcee --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc @@ -0,0 +1,81 @@ +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/base/internal/scoped_set_env.h" + +#ifdef _WIN32 +#include <windows.h> +#endif + +#include <cstdlib> + +#include "y_absl/base/internal/raw_logging.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace base_internal { + +namespace { + +#ifdef _WIN32 +const int kMaxEnvVarValueSize = 1024; +#endif + +void SetEnvVar(const char* name, const char* value) { +#ifdef _WIN32 + SetEnvironmentVariableA(name, value); +#else + if (value == nullptr) { + ::unsetenv(name); + } else { + ::setenv(name, value, 1); + } +#endif +} + +} // namespace + +ScopedSetEnv::ScopedSetEnv(const char* var_name, const char* new_value) + : var_name_(var_name), was_unset_(false) { +#ifdef _WIN32 + char buf[kMaxEnvVarValueSize]; + auto get_res = GetEnvironmentVariableA(var_name_.c_str(), buf, sizeof(buf)); + Y_ABSL_INTERNAL_CHECK(get_res < sizeof(buf), "value exceeds buffer size"); + + if (get_res == 0) { + was_unset_ = (GetLastError() == ERROR_ENVVAR_NOT_FOUND); + } else { + old_value_.assign(buf, get_res); + } + + SetEnvironmentVariableA(var_name_.c_str(), new_value); +#else + const char* val = ::getenv(var_name_.c_str()); + if (val == nullptr) { + was_unset_ = true; + } else { + old_value_ = val; + } +#endif + + SetEnvVar(var_name_.c_str(), new_value); +} + +ScopedSetEnv::~ScopedSetEnv() { + SetEnvVar(var_name_.c_str(), was_unset_ ? nullptr : old_value_.c_str()); +} + +} // namespace base_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h new file mode 100644 index 0000000000..f414235b28 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h @@ -0,0 +1,45 @@ +// +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ +#define Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ + +#include <util/generic/string.h> + +#include "y_absl/base/config.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace base_internal { + +class ScopedSetEnv { + public: + ScopedSetEnv(const char* var_name, const char* new_value); + ~ScopedSetEnv(); + + private: + TString var_name_; + TString old_value_; + + // True if the environment variable was initially not set. + bool was_unset_; +}; + +} // namespace base_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait/CMakeLists.txt deleted file mode 100644 index 8f6c31c88f..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ybase-internal-spinlock_wait) -target_compile_options(ybase-internal-spinlock_wait PRIVATE - -Wno-everything -) -target_include_directories(ybase-internal-spinlock_wait PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ybase-internal-spinlock_wait PUBLIC - contrib-libs-cxxsupp - yutil -) -target_sources(ybase-internal-spinlock_wait PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc new file mode 100644 index 0000000000..ae1e09f791 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc @@ -0,0 +1,88 @@ +// Copyright 2020 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/base/internal/strerror.h" + +#include <array> +#include <cerrno> +#include <cstddef> +#include <cstdio> +#include <cstring> +#include <util/generic/string.h> +#include <type_traits> + +#include "y_absl/base/internal/errno_saver.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace base_internal { +namespace { + +const char* StrErrorAdaptor(int errnum, char* buf, size_t buflen) { +#if defined(_WIN32) + int rc = strerror_s(buf, buflen, errnum); + buf[buflen - 1] = '\0'; // guarantee NUL termination + if (rc == 0 && strncmp(buf, "Unknown error", buflen) == 0) *buf = '\0'; + return buf; +#else + // The type of `ret` is platform-specific; both of these branches must compile + // either way but only one will execute on any given platform: + auto ret = strerror_r(errnum, buf, buflen); + if (std::is_same<decltype(ret), int>::value) { + // XSI `strerror_r`; `ret` is `int`: + if (ret) *buf = '\0'; + return buf; + } else { + // GNU `strerror_r`; `ret` is `char *`: + return reinterpret_cast<const char*>(ret); + } +#endif +} + +TString StrErrorInternal(int errnum) { + char buf[100]; + const char* str = StrErrorAdaptor(errnum, buf, sizeof buf); + if (*str == '\0') { + snprintf(buf, sizeof buf, "Unknown error %d", errnum); + str = buf; + } + return str; +} + +// kSysNerr is the number of errors from a recent glibc. `StrError()` falls back +// to `StrErrorAdaptor()` if the value is larger than this. +constexpr int kSysNerr = 135; + +std::array<TString, kSysNerr>* NewStrErrorTable() { + auto* table = new std::array<TString, kSysNerr>; + for (int i = 0; i < static_cast<int>(table->size()); ++i) { + (*table)[i] = StrErrorInternal(i); + } + return table; +} + +} // namespace + +TString StrError(int errnum) { + y_absl::base_internal::ErrnoSaver errno_saver; + static const auto* table = NewStrErrorTable(); + if (errnum >= 0 && errnum < static_cast<int>(table->size())) { + return (*table)[errnum]; + } + return StrErrorInternal(errnum); +} + +} // namespace base_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h new file mode 100644 index 0000000000..941c030616 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h @@ -0,0 +1,39 @@ +// Copyright 2020 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef Y_ABSL_BASE_INTERNAL_STRERROR_H_ +#define Y_ABSL_BASE_INTERNAL_STRERROR_H_ + +#include <util/generic/string.h> + +#include "y_absl/base/config.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace base_internal { + +// A portable and thread-safe alternative to C89's `strerror`. +// +// The C89 specification of `strerror` is not suitable for use in a +// multi-threaded application as the returned string may be changed by calls to +// `strerror` from another thread. The many non-stdlib alternatives differ +// enough in their names, availability, and semantics to justify this wrapper +// around them. `errno` will not be modified by a call to `y_absl::StrError`. +TString StrError(int errnum); + +} // namespace base_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_BASE_INTERNAL_STRERROR_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate/CMakeLists.txt deleted file mode 100644 index f76d7ce3f4..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ybase-internal-throw_delegate) -target_compile_options(ybase-internal-throw_delegate PRIVATE - -Wno-everything -) -target_include_directories(ybase-internal-throw_delegate PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ybase-internal-throw_delegate PUBLIC - contrib-libs-cxxsupp - yutil - ybase-internal-raw_logging - yabsl-base-log_severity -) -target_sources(ybase-internal-throw_delegate PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity/CMakeLists.txt deleted file mode 100644 index 14d4ecadd2..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-base-log_severity) -target_compile_options(yabsl-base-log_severity PRIVATE - -Wno-everything -) -target_include_directories(yabsl-base-log_severity PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-base-log_severity PUBLIC - contrib-libs-cxxsupp - yutil -) -target_sources(yabsl-base-log_severity PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/city/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/city/CMakeLists.txt index 6ed91fe706..d7bfa347ff 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/city/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/city/CMakeLists.txt @@ -7,21 +7,18 @@ -add_library(yabseil-cpp-tstring-y_absl-city) -target_compile_options(yabseil-cpp-tstring-y_absl-city PRIVATE +add_library(abseil-cpp-tstring-y_absl-city) +target_compile_options(abseil-cpp-tstring-y_absl-city PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-city PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-city PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-city PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-city PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity + abseil-cpp-tstring-y_absl-base ) -target_sources(yabseil-cpp-tstring-y_absl-city PRIVATE +target_sources(abseil-cpp-tstring-y_absl-city PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/city.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.txt index 19e2bc893e..3ec3daa2a0 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/CMakeLists.txt @@ -7,4 +7,29 @@ -add_library(abseil-cpp-tstring-y_absl-container INTERFACE) +add_library(abseil-cpp-tstring-y_absl-container) +target_compile_options(abseil-cpp-tstring-y_absl-container PRIVATE + -Wno-everything +) +target_include_directories(abseil-cpp-tstring-y_absl-container PUBLIC + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring +) +target_link_libraries(abseil-cpp-tstring-y_absl-container PUBLIC + contrib-libs-cxxsupp + yutil + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-debugging + abseil-cpp-tstring-y_absl-demangle + abseil-cpp-tstring-y_absl-hash + abseil-cpp-tstring-y_absl-numeric + abseil-cpp-tstring-y_absl-profiling + abseil-cpp-tstring-y_absl-strings + abseil-cpp-tstring-y_absl-synchronization + abseil-cpp-tstring-y_absl-time + abseil-cpp-tstring-y_absl-types +) +target_sources(abseil-cpp-tstring-y_absl-container PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc +) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt deleted file mode 100644 index ec58a48228..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ycontainer-internal-absl_hashtablez_sampler) -target_compile_options(ycontainer-internal-absl_hashtablez_sampler PRIVATE - -Wno-everything -) -target_include_directories(ycontainer-internal-absl_hashtablez_sampler PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ycontainer-internal-absl_hashtablez_sampler PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone -) -target_sources(ycontainer-internal-absl_hashtablez_sampler PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt deleted file mode 100644 index 5cf0ce6ba2..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ycontainer-internal-raw_hash_set) -target_compile_options(ycontainer-internal-raw_hash_set PRIVATE - -Wno-everything -) -target_include_directories(ycontainer-internal-raw_hash_set PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ycontainer-internal-raw_hash_set PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - ycontainer-internal-absl_hashtablez_sampler - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-hash - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone - abseil-cpp-tstring-y_absl-types - yabsl-types-bad_optional_access -) -target_sources(ycontainer-internal-raw_hash_set PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.txt index 4b3cd7b259..941146d1d1 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/CMakeLists.txt @@ -7,21 +7,26 @@ -add_library(yabseil-cpp-tstring-y_absl-debugging) -target_compile_options(yabseil-cpp-tstring-y_absl-debugging PRIVATE +add_library(abseil-cpp-tstring-y_absl-debugging) +target_compile_options(abseil-cpp-tstring-y_absl-debugging PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-debugging PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-debugging PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-debugging PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-debugging PUBLIC contrib-libs-cxxsupp yutil - ybase-internal-raw_logging - yabsl-base-log_severity + abseil-cpp-tstring-y_absl-base ) -target_sources(yabseil-cpp-tstring-y_absl-debugging PRIVATE +target_sources(abseil-cpp-tstring-y_absl-debugging PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/failure_signal_handler.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/address_is_readable.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/elf_mem_image.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/examine_stack.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/vdso_support.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check_disable.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/stacktrace.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.cc new file mode 100644 index 0000000000..0ac471b986 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.cc @@ -0,0 +1,69 @@ +// Copyright 2017 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Wrappers around lsan_interface functions. +// When lsan is not linked in, these functions are not available, +// therefore Abseil code which depends on these functions is conditioned on the +// definition of LEAK_SANITIZER. +#include "y_absl/base/attributes.h" +#include "y_absl/debugging/leak_check.h" + +#ifndef LEAK_SANITIZER + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +bool HaveLeakSanitizer() { return false; } +bool LeakCheckerIsActive() { return false; } +void DoIgnoreLeak(const void*) { } +void RegisterLivePointers(const void*, size_t) { } +void UnRegisterLivePointers(const void*, size_t) { } +LeakCheckDisabler::LeakCheckDisabler() { } +LeakCheckDisabler::~LeakCheckDisabler() { } +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#else + +#include <sanitizer/lsan_interface.h> + +#if Y_ABSL_HAVE_ATTRIBUTE_WEAK +extern "C" Y_ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off(); +#endif + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +bool HaveLeakSanitizer() { return true; } + +#if Y_ABSL_HAVE_ATTRIBUTE_WEAK +bool LeakCheckerIsActive() { + return !(&__lsan_is_turned_off && __lsan_is_turned_off()); +} +#else +bool LeakCheckerIsActive() { return true; } +#endif + +bool FindAndReportLeaks() { return __lsan_do_recoverable_leak_check(); } +void DoIgnoreLeak(const void* ptr) { __lsan_ignore_object(ptr); } +void RegisterLivePointers(const void* ptr, size_t size) { + __lsan_register_root_region(ptr, size); +} +void UnRegisterLivePointers(const void* ptr, size_t size) { + __lsan_unregister_root_region(ptr, size); +} +LeakCheckDisabler::LeakCheckDisabler() { __lsan_disable(); } +LeakCheckDisabler::~LeakCheckDisabler() { __lsan_enable(); } +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // LEAK_SANITIZER diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.h b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.h new file mode 100644 index 0000000000..154fe4805d --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check.h @@ -0,0 +1,133 @@ +// Copyright 2018 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ----------------------------------------------------------------------------- +// File: leak_check.h +// ----------------------------------------------------------------------------- +// +// This file contains functions that affect leak checking behavior within +// targets built with the LeakSanitizer (LSan), a memory leak detector that is +// integrated within the AddressSanitizer (ASan) as an additional component, or +// which can be used standalone. LSan and ASan are included (or can be provided) +// as additional components for most compilers such as Clang, gcc and MSVC. +// Note: this leak checking API is not yet supported in MSVC. +// Leak checking is enabled by default in all ASan builds. +// +// See https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer +// +// ----------------------------------------------------------------------------- +#ifndef Y_ABSL_DEBUGGING_LEAK_CHECK_H_ +#define Y_ABSL_DEBUGGING_LEAK_CHECK_H_ + +#include <cstddef> + +#include "y_absl/base/config.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN + +// HaveLeakSanitizer() +// +// Returns true if a leak-checking sanitizer (either ASan or standalone LSan) is +// currently built into this target. +bool HaveLeakSanitizer(); + +// LeakCheckerIsActive() +// +// Returns true if a leak-checking sanitizer (either ASan or standalone LSan) is +// currently built into this target and is turned on. +bool LeakCheckerIsActive(); + +// DoIgnoreLeak() +// +// Implements `IgnoreLeak()` below. This function should usually +// not be called directly; calling `IgnoreLeak()` is preferred. +void DoIgnoreLeak(const void* ptr); + +// IgnoreLeak() +// +// Instruct the leak sanitizer to ignore leak warnings on the object referenced +// by the passed pointer, as well as all heap objects transitively referenced +// by it. The passed object pointer can point to either the beginning of the +// object or anywhere within it. +// +// Example: +// +// static T* obj = IgnoreLeak(new T(...)); +// +// If the passed `ptr` does not point to an actively allocated object at the +// time `IgnoreLeak()` is called, the call is a no-op; if it is actively +// allocated, leak sanitizer will assume this object is referenced even if +// there is no actual reference in user memory. +// +template <typename T> +T* IgnoreLeak(T* ptr) { + DoIgnoreLeak(ptr); + return ptr; +} + +// FindAndReportLeaks() +// +// If any leaks are detected, prints a leak report and returns true. This +// function may be called repeatedly, and does not affect end-of-process leak +// checking. +// +// Example: +// if (FindAndReportLeaks()) { +// ... diagnostic already printed. Exit with failure code. +// exit(1) +// } +bool FindAndReportLeaks(); + +// LeakCheckDisabler +// +// This helper class indicates that any heap allocations done in the code block +// covered by the scoped object, which should be allocated on the stack, will +// not be reported as leaks. Leak check disabling will occur within the code +// block and any nested function calls within the code block. +// +// Example: +// +// void Foo() { +// LeakCheckDisabler disabler; +// ... code that allocates objects whose leaks should be ignored ... +// } +// +// REQUIRES: Destructor runs in same thread as constructor +class LeakCheckDisabler { + public: + LeakCheckDisabler(); + LeakCheckDisabler(const LeakCheckDisabler&) = delete; + LeakCheckDisabler& operator=(const LeakCheckDisabler&) = delete; + ~LeakCheckDisabler(); +}; + +// RegisterLivePointers() +// +// Registers `ptr[0,size-1]` as pointers to memory that is still actively being +// referenced and for which leak checking should be ignored. This function is +// useful if you store pointers in mapped memory, for memory ranges that we know +// are correct but for which normal analysis would flag as leaked code. +void RegisterLivePointers(const void* ptr, size_t size); + +// UnRegisterLivePointers() +// +// Deregisters the pointers previously marked as active in +// `RegisterLivePointers()`, enabling leak checking of those pointers. +void UnRegisterLivePointers(const void* ptr, size_t size); + +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_DEBUGGING_LEAK_CHECK_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check_disable.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check_disable.cc new file mode 100644 index 0000000000..924d6e3d54 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/leak_check_disable.cc @@ -0,0 +1,20 @@ +// Copyright 2017 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Disable LeakSanitizer when this file is linked in. +// This function overrides __lsan_is_turned_off from sanitizer/lsan_interface.h +extern "C" int __lsan_is_turned_off(); +extern "C" int __lsan_is_turned_off() { + return 1; +} diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/stacktrace/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/stacktrace/CMakeLists.txt deleted file mode 100644 index de152ad47f..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/stacktrace/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-debugging-stacktrace) -target_compile_options(yabsl-debugging-stacktrace PRIVATE - -Wno-everything -) -target_include_directories(yabsl-debugging-stacktrace PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-debugging-stacktrace PUBLIC - contrib-libs-cxxsupp - yutil - ybase-internal-raw_logging - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging -) -target_sources(yabsl-debugging-stacktrace PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/stacktrace.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize/CMakeLists.txt deleted file mode 100644 index 5953f62ec8..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-debugging-symbolize) -target_compile_options(yabsl-debugging-symbolize PRIVATE - -Wno-everything -) -target_include_directories(yabsl-debugging-symbolize PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-debugging-symbolize PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal -) -target_sources(yabsl-debugging-symbolize PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/symbolize.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/demangle/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/demangle/CMakeLists.txt index be77485656..cabd5665b4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/demangle/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/demangle/CMakeLists.txt @@ -7,21 +7,18 @@ -add_library(yabseil-cpp-tstring-y_absl-demangle) -target_compile_options(yabseil-cpp-tstring-y_absl-demangle PRIVATE +add_library(abseil-cpp-tstring-y_absl-demangle) +target_compile_options(abseil-cpp-tstring-y_absl-demangle PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-demangle PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-demangle PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-demangle PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-demangle PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity + abseil-cpp-tstring-y_absl-base ) -target_sources(yabseil-cpp-tstring-y_absl-demangle PRIVATE +target_sources(abseil-cpp-tstring-y_absl-demangle PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/debugging/internal/demangle.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.txt deleted file mode 100644 index d29cb14fd9..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(abseil-cpp-tstring-y_absl-functional INTERFACE) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.txt index 3507682846..aeef5a67e2 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/hash/CMakeLists.txt @@ -7,31 +7,23 @@ -add_library(yabseil-cpp-tstring-y_absl-hash) -target_compile_options(yabseil-cpp-tstring-y_absl-hash PRIVATE +add_library(abseil-cpp-tstring-y_absl-hash) +target_compile_options(abseil-cpp-tstring-y_absl-hash PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-hash PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-hash PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-hash PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-hash PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-city - yabsl-hash-internal - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-city + abseil-cpp-tstring-y_absl-numeric + abseil-cpp-tstring-y_absl-strings abseil-cpp-tstring-y_absl-types - yabsl-types-bad_optional_access - yabsl-types-bad_variant_access - y_absl-types-internal ) -target_sources(yabseil-cpp-tstring-y_absl-hash PRIVATE +target_sources(abseil-cpp-tstring-y_absl-hash PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/hash.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/low_level_hash.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/CMakeLists.txt deleted file mode 100644 index a4032a712c..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-hash-internal) -target_compile_options(yabsl-hash-internal PRIVATE - -Wno-everything -) -target_include_directories(yabsl-hash-internal PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-hash-internal PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-numeric -) -target_sources(yabsl-hash-internal PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal/low_level_hash.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.txt index b3005ce529..c8845db2e4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/meta/CMakeLists.txt @@ -9,5 +9,5 @@ add_library(abseil-cpp-tstring-y_absl-meta INTERFACE) target_link_libraries(abseil-cpp-tstring-y_absl-meta INTERFACE - yabseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-base ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.txt index f96a127af1..15d41ecc0f 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/CMakeLists.txt @@ -7,17 +7,17 @@ -add_library(yabseil-cpp-tstring-y_absl-numeric) -target_compile_options(yabseil-cpp-tstring-y_absl-numeric PRIVATE +add_library(abseil-cpp-tstring-y_absl-numeric) +target_compile_options(abseil-cpp-tstring-y_absl-numeric PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-numeric PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-numeric PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-numeric PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-numeric PUBLIC contrib-libs-cxxsupp yutil ) -target_sources(yabseil-cpp-tstring-y_absl-numeric PRIVATE +target_sources(abseil-cpp-tstring-y_absl-numeric PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/exponential_biased/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.txt index 9795f4fe89..519d4c432b 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/exponential_biased/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/CMakeLists.txt @@ -7,17 +7,18 @@ -add_library(yprofiling-internal-exponential_biased) -target_compile_options(yprofiling-internal-exponential_biased PRIVATE +add_library(abseil-cpp-tstring-y_absl-profiling) +target_compile_options(abseil-cpp-tstring-y_absl-profiling PRIVATE -Wno-everything ) -target_include_directories(yprofiling-internal-exponential_biased PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-profiling PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yprofiling-internal-exponential_biased PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-profiling PUBLIC contrib-libs-cxxsupp yutil ) -target_sources(yprofiling-internal-exponential_biased PRIVATE +target_sources(abseil-cpp-tstring-y_absl-profiling PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/exponential_biased.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.cc new file mode 100644 index 0000000000..03892bfa3e --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.cc @@ -0,0 +1,53 @@ +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/profiling/internal/periodic_sampler.h" + +#include <atomic> + +#include "y_absl/profiling/internal/exponential_biased.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace profiling_internal { + +int64_t PeriodicSamplerBase::GetExponentialBiased(int period) noexcept { + return rng_.GetStride(period); +} + +bool PeriodicSamplerBase::SubtleConfirmSample() noexcept { + int current_period = period(); + + // Deal with period case 0 (always off) and 1 (always on) + if (Y_ABSL_PREDICT_FALSE(current_period < 2)) { + stride_ = 0; + return current_period == 1; + } + + // Check if this is the first call to Sample() + if (Y_ABSL_PREDICT_FALSE(stride_ == 1)) { + stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period)); + if (static_cast<int64_t>(stride_) < -1) { + ++stride_; + return false; + } + } + + stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period)); + return true; +} + +} // namespace profiling_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.h b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.h new file mode 100644 index 0000000000..6faa2d7566 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/profiling/internal/periodic_sampler.h @@ -0,0 +1,211 @@ +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef Y_ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_ +#define Y_ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_ + +#include <stdint.h> + +#include <atomic> + +#include "y_absl/base/optimization.h" +#include "y_absl/profiling/internal/exponential_biased.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace profiling_internal { + +// PeriodicSamplerBase provides the basic period sampler implementation. +// +// This is the base class for the templated PeriodicSampler class, which holds +// a global std::atomic value identified by a user defined tag, such that +// each specific PeriodSampler implementation holds its own global period. +// +// PeriodicSamplerBase is thread-compatible except where stated otherwise. +class PeriodicSamplerBase { + public: + // PeriodicSamplerBase is trivial / copyable / movable / destructible. + PeriodicSamplerBase() = default; + PeriodicSamplerBase(PeriodicSamplerBase&&) = default; + PeriodicSamplerBase(const PeriodicSamplerBase&) = default; + + // Returns true roughly once every `period` calls. This is established by a + // randomly picked `stride` that is counted down on each call to `Sample`. + // This stride is picked such that the probability of `Sample()` returning + // true is 1 in `period`. + inline bool Sample() noexcept; + + // The below methods are intended for optimized use cases where the + // size of the inlined fast path code is highly important. Applications + // should use the `Sample()` method unless they have proof that their + // specific use case requires the optimizations offered by these methods. + // + // An example of such a use case is SwissTable sampling. All sampling checks + // are in inlined SwissTable methods, and the number of call sites is huge. + // In this case, the inlined code size added to each translation unit calling + // SwissTable methods is non-trivial. + // + // The `SubtleMaybeSample()` function spuriously returns true even if the + // function should not be sampled, applications MUST match each call to + // 'SubtleMaybeSample()' returning true with a `SubtleConfirmSample()` call, + // and use the result of the latter as the sampling decision. + // In other words: the code should logically be equivalent to: + // + // if (SubtleMaybeSample() && SubtleConfirmSample()) { + // // Sample this call + // } + // + // In the 'inline-size' optimized case, the `SubtleConfirmSample()` call can + // be placed out of line, for example, the typical use case looks as follows: + // + // // --- frobber.h ----------- + // void FrobberSampled(); + // + // inline void FrobberImpl() { + // // ... + // } + // + // inline void Frobber() { + // if (Y_ABSL_PREDICT_FALSE(sampler.SubtleMaybeSample())) { + // FrobberSampled(); + // } else { + // FrobberImpl(); + // } + // } + // + // // --- frobber.cc ----------- + // void FrobberSampled() { + // if (!sampler.SubtleConfirmSample())) { + // // Spurious false positive + // FrobberImpl(); + // return; + // } + // + // // Sampled execution + // // ... + // } + inline bool SubtleMaybeSample() noexcept; + bool SubtleConfirmSample() noexcept; + + protected: + // We explicitly don't use a virtual destructor as this class is never + // virtually destroyed, and it keeps the class trivial, which avoids TLS + // prologue and epilogue code for our TLS instances. + ~PeriodicSamplerBase() = default; + + // Returns the next stride for our sampler. + // This function is virtual for testing purposes only. + virtual int64_t GetExponentialBiased(int period) noexcept; + + private: + // Returns the current period of this sampler. Thread-safe. + virtual int period() const noexcept = 0; + + // Keep and decrement stride_ as an unsigned integer, but compare the value + // to zero casted as a signed int. clang and msvc do not create optimum code + // if we use signed for the combined decrement and sign comparison. + // + // Below 3 alternative options, all compiles generate the best code + // using the unsigned increment <---> signed int comparison option. + // + // Option 1: + // int64_t stride_; + // if (Y_ABSL_PREDICT_TRUE(++stride_ < 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/R5MzzA + // GCC ppc (OK) : https://gcc.godbolt.org/z/z7NZAt + // Clang x64 (BAD): https://gcc.godbolt.org/z/t4gPsd + // ICC x64 (OK) : https://gcc.godbolt.org/z/rE6s8W + // MSVC x64 (OK) : https://gcc.godbolt.org/z/ARMXqS + // + // Option 2: + // int64_t stride_ = 0; + // if (Y_ABSL_PREDICT_TRUE(--stride_ >= 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/jSQxYK + // GCC ppc (OK) : https://gcc.godbolt.org/z/VJdYaA + // Clang x64 (BAD): https://gcc.godbolt.org/z/Xm4NjX + // ICC x64 (OK) : https://gcc.godbolt.org/z/4snaFd + // MSVC x64 (BAD): https://gcc.godbolt.org/z/BgnEKE + // + // Option 3: + // uint64_t stride_; + // if (Y_ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) { ... } + // + // GCC x64 (OK) : https://gcc.godbolt.org/z/bFbfPy + // GCC ppc (OK) : https://gcc.godbolt.org/z/S9KkUE + // Clang x64 (OK) : https://gcc.godbolt.org/z/UYzRb4 + // ICC x64 (OK) : https://gcc.godbolt.org/z/ptTNfD + // MSVC x64 (OK) : https://gcc.godbolt.org/z/76j4-5 + uint64_t stride_ = 0; + y_absl::profiling_internal::ExponentialBiased rng_; +}; + +inline bool PeriodicSamplerBase::SubtleMaybeSample() noexcept { + // See comments on `stride_` for the unsigned increment / signed compare. + if (Y_ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) { + return false; + } + return true; +} + +inline bool PeriodicSamplerBase::Sample() noexcept { + return Y_ABSL_PREDICT_FALSE(SubtleMaybeSample()) ? SubtleConfirmSample() + : false; +} + +// PeriodicSampler is a concreted periodic sampler implementation. +// The user provided Tag identifies the implementation, and is required to +// isolate the global state of this instance from other instances. +// +// Typical use case: +// +// struct HashTablezTag {}; +// thread_local PeriodicSampler sampler; +// +// void HashTableSamplingLogic(...) { +// if (sampler.Sample()) { +// HashTableSlowSamplePath(...); +// } +// } +// +template <typename Tag, int default_period = 0> +class PeriodicSampler final : public PeriodicSamplerBase { + public: + ~PeriodicSampler() = default; + + int period() const noexcept final { + return period_.load(std::memory_order_relaxed); + } + + // Sets the global period for this sampler. Thread-safe. + // Setting a period of 0 disables the sampler, i.e., every call to Sample() + // will return false. Setting a period of 1 puts the sampler in 'always on' + // mode, i.e., every call to Sample() returns true. + static void SetGlobalPeriod(int period) { + period_.store(period, std::memory_order_relaxed); + } + + private: + static std::atomic<int> period_; +}; + +template <typename Tag, int default_period> +std::atomic<int> PeriodicSampler<Tag, default_period>::period_(default_period); + +} // namespace profiling_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.txt index 027ae28b9a..cb1f4e1579 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/CMakeLists.txt @@ -7,44 +7,27 @@ -add_library(yabseil-cpp-tstring-y_absl-status) -target_compile_options(yabseil-cpp-tstring-y_absl-status PRIVATE +add_library(abseil-cpp-tstring-y_absl-status) +target_compile_options(abseil-cpp-tstring-y_absl-status PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-status PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-status PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-status PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-status PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-strings - yabsl-strings-cord - ystrings-internal-absl_cord_internal - ystrings-internal-absl_strings_internal - ystrings-internal-cordz_functions - ystrings-internal-cordz_handle - ystrings-internal-cordz_info - ystrings-internal-str_format - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone - yabsl-types-bad_optional_access + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-debugging + abseil-cpp-tstring-y_absl-demangle + abseil-cpp-tstring-y_absl-numeric + abseil-cpp-tstring-y_absl-profiling + abseil-cpp-tstring-y_absl-strings + abseil-cpp-tstring-y_absl-synchronization + abseil-cpp-tstring-y_absl-time + abseil-cpp-tstring-y_absl-types ) -target_sources(yabseil-cpp-tstring-y_absl-status PRIVATE +target_sources(abseil-cpp-tstring-y_absl-status PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor/CMakeLists.txt deleted file mode 100644 index 04386d7699..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-status-statusor) -target_compile_options(yabsl-status-statusor PRIVATE - -Wno-everything -) -target_include_directories(yabsl-status-statusor PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-status-statusor PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-status - yabseil-cpp-tstring-y_absl-strings - yabsl-strings-cord - ystrings-internal-absl_cord_internal - ystrings-internal-absl_strings_internal - ystrings-internal-cordz_functions - ystrings-internal-cordz_handle - ystrings-internal-cordz_info - ystrings-internal-str_format - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone - yabsl-types-bad_optional_access - yabsl-types-bad_variant_access -) -target_sources(yabsl-status-statusor PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.txt index a5df46fd83..c14b657da5 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/CMakeLists.txt @@ -7,31 +7,47 @@ -add_library(yabseil-cpp-tstring-y_absl-strings) -target_compile_options(yabseil-cpp-tstring-y_absl-strings PRIVATE +add_library(abseil-cpp-tstring-y_absl-strings) +target_compile_options(abseil-cpp-tstring-y_absl-strings PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-strings PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-strings PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-strings PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-strings PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-numeric - ystrings-internal-absl_strings_internal + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-numeric ) -target_sources(yabseil-cpp-tstring-y_absl-strings PRIVATE +target_sources(abseil-cpp-tstring-y_absl-strings PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/ascii.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/charconv.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/charconv_bigint.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/charconv_parse.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree_navigator.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree_reader.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_consume.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_functions.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_handle.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/escaping.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/memutil.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/ostringstream.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/float_conversion.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/output.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/utf8.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/match.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/numbers.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.cc diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord/CMakeLists.txt deleted file mode 100644 index ded7f22d4a..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-strings-cord) -target_compile_options(yabsl-strings-cord PRIVATE - -Wno-everything -) -target_include_directories(yabsl-strings-cord PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-strings-cord PUBLIC - contrib-libs-cxxsupp - yutil - abseil-cpp-tstring-y_absl-algorithm - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - abseil-cpp-tstring-y_absl-container - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - abseil-cpp-tstring-y_absl-functional - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_cord_internal - ystrings-internal-absl_strings_internal - ystrings-internal-cordz_functions - ystrings-internal-cordz_handle - ystrings-internal-cordz_info - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone - abseil-cpp-tstring-y_absl-types - yabsl-types-bad_optional_access - abseil-cpp-tstring-y_absl-utility -) -target_sources(yabsl-strings-cord PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/cord.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_cord_internal/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_cord_internal/CMakeLists.txt deleted file mode 100644 index b030c3d1cd..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_cord_internal/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-absl_cord_internal) -target_compile_options(ystrings-internal-absl_cord_internal PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-absl_cord_internal PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-absl_cord_internal PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal -) -target_sources(ystrings-internal-absl_cord_internal PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_internal.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree_navigator.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_btree_reader.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_consume.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cord_rep_ring.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_strings_internal/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_strings_internal/CMakeLists.txt deleted file mode 100644 index d30ee76373..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/absl_strings_internal/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-absl_strings_internal) -target_compile_options(ystrings-internal-absl_strings_internal PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-absl_strings_internal PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-absl_strings_internal PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity -) -target_sources(ystrings-internal-absl_strings_internal PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/escaping.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/ostringstream.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/utf8.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_functions/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_functions/CMakeLists.txt deleted file mode 100644 index b0d36a3db0..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_functions/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-cordz_functions) -target_compile_options(ystrings-internal-cordz_functions PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-cordz_functions PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-cordz_functions PUBLIC - contrib-libs-cxxsupp - yutil - ybase-internal-raw_logging - yabsl-base-log_severity - yprofiling-internal-exponential_biased -) -target_sources(ystrings-internal-cordz_functions PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_functions.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_handle/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_handle/CMakeLists.txt deleted file mode 100644 index 2e409ccadd..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_handle/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-cordz_handle) -target_compile_options(ystrings-internal-cordz_handle PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-cordz_handle PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-cordz_handle PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone -) -target_sources(ystrings-internal-cordz_handle PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_handle.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info/CMakeLists.txt deleted file mode 100644 index c632857444..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-cordz_info) -target_compile_options(ystrings-internal-cordz_info PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-cordz_info PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-cordz_info PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yprofiling-internal-exponential_biased - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_cord_internal - ystrings-internal-absl_strings_internal - ystrings-internal-cordz_functions - ystrings-internal-cordz_handle - yabseil-cpp-tstring-y_absl-synchronization - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone -) -target_sources(ystrings-internal-cordz_info PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_info.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.cc new file mode 100644 index 0000000000..fda536c7f4 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.cc @@ -0,0 +1,64 @@ +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/strings/internal/cordz_sample_token.h" + +#include "y_absl/base/config.h" +#include "y_absl/strings/internal/cordz_handle.h" +#include "y_absl/strings/internal/cordz_info.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace cord_internal { + +CordzSampleToken::Iterator& CordzSampleToken::Iterator::operator++() { + if (current_) { + current_ = current_->Next(*token_); + } + return *this; +} + +CordzSampleToken::Iterator CordzSampleToken::Iterator::operator++(int) { + Iterator it(*this); + operator++(); + return it; +} + +bool operator==(const CordzSampleToken::Iterator& lhs, + const CordzSampleToken::Iterator& rhs) { + return lhs.current_ == rhs.current_ && + (lhs.current_ == nullptr || lhs.token_ == rhs.token_); +} + +bool operator!=(const CordzSampleToken::Iterator& lhs, + const CordzSampleToken::Iterator& rhs) { + return !(lhs == rhs); +} + +CordzSampleToken::Iterator::reference CordzSampleToken::Iterator::operator*() + const { + return *current_; +} + +CordzSampleToken::Iterator::pointer CordzSampleToken::Iterator::operator->() + const { + return current_; +} + +CordzSampleToken::Iterator::Iterator(const CordzSampleToken* token) + : token_(token), current_(CordzInfo::Head(*token)) {} + +} // namespace cord_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.h b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.h new file mode 100644 index 0000000000..8ef2f64dc6 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/cordz_sample_token.h @@ -0,0 +1,97 @@ +// Copyright 2019 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/base/config.h" +#include "y_absl/strings/internal/cordz_handle.h" +#include "y_absl/strings/internal/cordz_info.h" + +#ifndef Y_ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_ +#define Y_ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_ + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +namespace cord_internal { + +// The existence of a CordzSampleToken guarantees that a reader can traverse the +// global_cordz_infos_head linked-list without needing to hold a mutex. When a +// CordzSampleToken exists, all CordzInfo objects that would be destroyed are +// instead appended to a deletion queue. When the CordzSampleToken is destroyed, +// it will also clean up any of these CordzInfo objects. +// +// E.g., ST are CordzSampleToken objects and CH are CordzHandle objects. +// ST1 <- CH1 <- CH2 <- ST2 <- CH3 <- global_delete_queue_tail +// +// This list tracks that CH1 and CH2 were created after ST1, so the thread +// holding ST1 might have a referece to CH1, CH2, ST2, and CH3. However, ST2 was +// created later, so the thread holding the ST2 token cannot have a reference to +// ST1, CH1, or CH2. If ST1 is cleaned up first, that thread will delete ST1, +// CH1, and CH2. If instead ST2 is cleaned up first, that thread will only +// delete ST2. +// +// If ST1 is cleaned up first, the new list will be: +// ST2 <- CH3 <- global_delete_queue_tail +// +// If ST2 is cleaned up first, the new list will be: +// ST1 <- CH1 <- CH2 <- CH3 <- global_delete_queue_tail +// +// All new CordzHandle objects are appended to the list, so if a new thread +// comes along before either ST1 or ST2 are cleaned up, the new list will be: +// ST1 <- CH1 <- CH2 <- ST2 <- CH3 <- ST3 <- global_delete_queue_tail +// +// A thread must hold the global_delete_queue_mu mutex whenever it's altering +// this list. +// +// It is safe for thread that holds a CordzSampleToken to read +// global_cordz_infos at any time since the objects it is able to retrieve will +// not be deleted while the CordzSampleToken exists. +class CordzSampleToken : public CordzSnapshot { + public: + class Iterator { + public: + using iterator_category = std::input_iterator_tag; + using value_type = const CordzInfo&; + using difference_type = ptrdiff_t; + using pointer = const CordzInfo*; + using reference = value_type; + + Iterator() = default; + + Iterator& operator++(); + Iterator operator++(int); + friend bool operator==(const Iterator& lhs, const Iterator& rhs); + friend bool operator!=(const Iterator& lhs, const Iterator& rhs); + reference operator*() const; + pointer operator->() const; + + private: + friend class CordzSampleToken; + explicit Iterator(const CordzSampleToken* token); + + const CordzSampleToken* token_ = nullptr; + pointer current_ = nullptr; + }; + + CordzSampleToken() = default; + CordzSampleToken(const CordzSampleToken&) = delete; + CordzSampleToken& operator=(const CordzSampleToken&) = delete; + + Iterator begin() { return Iterator(this); } + Iterator end() { return Iterator(); } +}; + +} // namespace cord_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/CMakeLists.txt deleted file mode 100644 index 8d9dc3373c..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(ystrings-internal-str_format) -target_compile_options(ystrings-internal-str_format PRIVATE - -Wno-everything -) -target_include_directories(ystrings-internal-str_format PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(ystrings-internal-str_format PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal -) -target_sources(ystrings-internal-str_format PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/arg.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/bind.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/extension.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/float_conversion.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/output.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format/parser.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.txt index 3cb09caec8..00af2c9260 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/CMakeLists.txt @@ -7,38 +7,28 @@ -add_library(yabseil-cpp-tstring-y_absl-synchronization) -target_compile_options(yabseil-cpp-tstring-y_absl-synchronization PRIVATE +add_library(abseil-cpp-tstring-y_absl-synchronization) +target_compile_options(abseil-cpp-tstring-y_absl-synchronization PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-synchronization PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-synchronization PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-synchronization PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-synchronization PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-debugging - yabsl-debugging-stacktrace - yabsl-debugging-symbolize - yabseil-cpp-tstring-y_absl-demangle - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal - yabsl-synchronization-internal - yabseil-cpp-tstring-y_absl-time - yabsl-time-civil_time - yabsl-time-time_zone + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-debugging + abseil-cpp-tstring-y_absl-demangle + abseil-cpp-tstring-y_absl-numeric + abseil-cpp-tstring-y_absl-strings + abseil-cpp-tstring-y_absl-time ) -target_sources(yabseil-cpp-tstring-y_absl-synchronization PRIVATE +target_sources(abseil-cpp-tstring-y_absl-synchronization PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/barrier.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/blocking_counter.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.cc diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/CMakeLists.txt deleted file mode 100644 index e6c2391a88..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-synchronization-internal) -target_compile_options(yabsl-synchronization-internal PRIVATE - -Wno-everything -) -target_include_directories(yabsl-synchronization-internal PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-synchronization-internal PUBLIC - contrib-libs-cxxsupp - yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-low_level_alloc - ybase-internal-raw_logging - ybase-internal-spinlock_wait - yabsl-base-log_severity -) -target_sources(yabsl-synchronization-internal PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.txt index 75a6461a78..0cceb64e60 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/CMakeLists.txt @@ -7,31 +7,34 @@ -add_library(yabseil-cpp-tstring-y_absl-time) -target_compile_options(yabseil-cpp-tstring-y_absl-time PRIVATE +add_library(abseil-cpp-tstring-y_absl-time) +target_compile_options(abseil-cpp-tstring-y_absl-time PRIVATE -Wno-everything ) -target_include_directories(yabseil-cpp-tstring-y_absl-time PUBLIC +target_include_directories(abseil-cpp-tstring-y_absl-time PUBLIC ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring ) -target_link_libraries(yabseil-cpp-tstring-y_absl-time PUBLIC +target_link_libraries(abseil-cpp-tstring-y_absl-time PUBLIC contrib-libs-cxxsupp yutil - yabseil-cpp-tstring-y_absl-base - ybase-internal-raw_logging - ybase-internal-spinlock_wait - ybase-internal-throw_delegate - yabsl-base-log_severity - yabseil-cpp-tstring-y_absl-numeric - yabseil-cpp-tstring-y_absl-strings - ystrings-internal-absl_strings_internal - yabsl-time-civil_time - yabsl-time-time_zone + abseil-cpp-tstring-y_absl-base + abseil-cpp-tstring-y_absl-numeric + abseil-cpp-tstring-y_absl-strings ) -target_sources(yabseil-cpp-tstring-y_absl-time PRIVATE +target_sources(abseil-cpp-tstring-y_absl-time PRIVATE ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/clock.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/duration.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/civil_time_detail.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_fixed.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_format.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_if.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_impl.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_libc.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_lookup.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_posix.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/zone_info_source.cc ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/time.cc ) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time/CMakeLists.txt deleted file mode 100644 index a0d36c0e89..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/civil_time/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-time-civil_time) -target_compile_options(yabsl-time-civil_time PRIVATE - -Wno-everything -) -target_include_directories(yabsl-time-civil_time PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-time-civil_time PUBLIC - contrib-libs-cxxsupp - yutil -) -target_sources(yabsl-time-civil_time PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/civil_time_detail.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/time_zone/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/time/time_zone/CMakeLists.txt deleted file mode 100644 index d14b8cc14c..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/time_zone/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-time-time_zone) -target_compile_options(yabsl-time-time_zone PRIVATE - -Wno-everything -) -target_include_directories(yabsl-time-time_zone PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-time-time_zone PUBLIC - contrib-libs-cxxsupp - yutil -) -target_sources(yabsl-time-time_zone PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_fixed.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_format.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_if.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_impl.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_info.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_libc.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_lookup.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/time_zone_posix.cc - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/time/internal/cctz/src/zone_info_source.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.txt index 885607e13e..22e18b5ded 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.txt +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/CMakeLists.txt @@ -7,4 +7,20 @@ -add_library(abseil-cpp-tstring-y_absl-types INTERFACE) +add_library(abseil-cpp-tstring-y_absl-types) +target_compile_options(abseil-cpp-tstring-y_absl-types PRIVATE + -Wno-everything +) +target_include_directories(abseil-cpp-tstring-y_absl-types PUBLIC + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring +) +target_link_libraries(abseil-cpp-tstring-y_absl-types PUBLIC + contrib-libs-cxxsupp + yutil + abseil-cpp-tstring-y_absl-base +) +target_sources(abseil-cpp-tstring-y_absl-types PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc + ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc +) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc new file mode 100644 index 0000000000..14ed288ece --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.cc @@ -0,0 +1,46 @@ +// Copyright 2017 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "y_absl/types/bad_any_cast.h" + +#ifndef Y_ABSL_USES_STD_ANY + +#include <cstdlib> + +#include "y_absl/base/config.h" +#include "y_absl/base/internal/raw_logging.h" + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN + +bad_any_cast::~bad_any_cast() = default; + +const char* bad_any_cast::what() const noexcept { return "Bad any cast"; } + +namespace any_internal { + +void ThrowBadAnyCast() { +#ifdef Y_ABSL_HAVE_EXCEPTIONS + throw bad_any_cast(); +#else + Y_ABSL_RAW_LOG(FATAL, "Bad any cast"); + std::abort(); +#endif +} + +} // namespace any_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_USES_STD_ANY diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.h b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.h new file mode 100644 index 0000000000..a459f8c272 --- /dev/null +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_any_cast.h @@ -0,0 +1,75 @@ +// Copyright 2018 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ----------------------------------------------------------------------------- +// bad_any_cast.h +// ----------------------------------------------------------------------------- +// +// This header file defines the `y_absl::bad_any_cast` type. + +#ifndef Y_ABSL_TYPES_BAD_ANY_CAST_H_ +#define Y_ABSL_TYPES_BAD_ANY_CAST_H_ + +#include <typeinfo> + +#include "y_absl/base/config.h" + +#ifdef Y_ABSL_USES_STD_ANY + +#include <any> + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN +using std::bad_any_cast; +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#else // Y_ABSL_USES_STD_ANY + +namespace y_absl { +Y_ABSL_NAMESPACE_BEGIN + +// ----------------------------------------------------------------------------- +// bad_any_cast +// ----------------------------------------------------------------------------- +// +// An `y_absl::bad_any_cast` type is an exception type that is thrown when +// failing to successfully cast the return value of an `y_absl::any` object. +// +// Example: +// +// auto a = y_absl::any(65); +// y_absl::any_cast<int>(a); // 65 +// try { +// y_absl::any_cast<char>(a); +// } catch(const y_absl::bad_any_cast& e) { +// std::cout << "Bad any cast: " << e.what() << '\n'; +// } +class bad_any_cast : public std::bad_cast { + public: + ~bad_any_cast() override; + const char* what() const noexcept override; +}; + +namespace any_internal { + +[[noreturn]] void ThrowBadAnyCast(); + +} // namespace any_internal +Y_ABSL_NAMESPACE_END +} // namespace y_absl + +#endif // Y_ABSL_USES_STD_ANY + +#endif // Y_ABSL_TYPES_BAD_ANY_CAST_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access/CMakeLists.txt deleted file mode 100644 index b6de1cd96a..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-types-bad_optional_access) -target_compile_options(yabsl-types-bad_optional_access PRIVATE - -Wno-everything -) -target_include_directories(yabsl-types-bad_optional_access PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-types-bad_optional_access PUBLIC - contrib-libs-cxxsupp - yutil - ybase-internal-raw_logging - yabsl-base-log_severity -) -target_sources(yabsl-types-bad_optional_access PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_optional_access.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access/CMakeLists.txt deleted file mode 100644 index 44ead19328..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(yabsl-types-bad_variant_access) -target_compile_options(yabsl-types-bad_variant_access PRIVATE - -Wno-everything -) -target_include_directories(yabsl-types-bad_variant_access PUBLIC - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring -) -target_link_libraries(yabsl-types-bad_variant_access PUBLIC - contrib-libs-cxxsupp - yutil - ybase-internal-raw_logging - yabsl-base-log_severity -) -target_sources(yabsl-types-bad_variant_access PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_access.cc -) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/CMakeLists.txt deleted file mode 100644 index 7047870733..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/types/internal/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(y_absl-types-internal INTERFACE) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.txt deleted file mode 100644 index ec6db3764b..0000000000 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -# This file was gererated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(abseil-cpp-tstring-y_absl-utility INTERFACE) |