diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-02-22 19:46:09 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-02-22 19:46:09 +0300 |
commit | 8cedb7ddce55e8b6b45f43fd83b061fbca4f5de0 (patch) | |
tree | b00b566b72935dee2f40f76ee84217be51f46cab | |
parent | 958ccb82c78a47b450486423eddaffed6c2e69de (diff) | |
download | ydb-8cedb7ddce55e8b6b45f43fd83b061fbca4f5de0.tar.gz |
intermediate changes
ref:3a98b1243714ce16192c86701533da9f016d4f17
-rw-r--r-- | contrib/libs/libaio/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/cache/cache.h | 33 | ||||
-rw-r--r-- | ydb/library/pdisk_io/CMakeLists.txt | 2 |
3 files changed, 23 insertions, 14 deletions
diff --git a/contrib/libs/libaio/ya.make b/contrib/libs/libaio/ya.make index 6099250bf54..5758f19f8e9 100644 --- a/contrib/libs/libaio/ya.make +++ b/contrib/libs/libaio/ya.make @@ -18,7 +18,7 @@ NO_RUNTIME() OPENSOURCE_EXPORT_REPLACEMENT( CMAKE AIO - CMAKE_TARGET AIO + CMAKE_TARGET AIO::aio ) IF (NOT EXPORT_CMAKE) diff --git a/library/cpp/cache/cache.h b/library/cpp/cache/cache.h index 6f496305e27..022a144c9b7 100644 --- a/library/cpp/cache/cache.h +++ b/library/cpp/cache/cache.h @@ -451,11 +451,11 @@ private: size_t MaxSize; }; -template <typename TKey, typename TValue, typename TListType, typename TDeleter> +template <typename TKey, typename TValue, typename TListType, typename TDeleter, typename TAllocator = std::allocator<void>> class TCache { typedef typename TListType::TItem TItem; typedef typename TItem::THash THash; - typedef THashMultiSet<TItem, THash, typename TItem::TEqualTo> TIndex; + typedef THashMultiSet<TItem, THash, typename TItem::TEqualTo, TAllocator> TIndex; typedef typename TIndex::iterator TIndexIterator; typedef typename TIndex::const_iterator TIndexConstIterator; @@ -496,7 +496,7 @@ public: return Iter->Value; } - friend class TCache<TKey, TValue, TListType, TDeleter>; + friend class TCache<TKey, TValue, TListType, TDeleter, TAllocator>; private: TIndexConstIterator Iter; @@ -652,6 +652,15 @@ public: return List.GetMaxSize(); } + void Reserve(size_t hint) { + Index.reserve(hint); + } + + typedef typename TIndex::node_allocator_type TNodeAllocatorType; + TNodeAllocatorType& GetNodeAllocator() { + return Index.GetNodeAllocator(); + } + protected: TIndex Index; TListType List; @@ -681,10 +690,10 @@ struct TNoopDelete { } }; -template <typename TKey, typename TValue, typename TDeleter = TNoopDelete, class TSizeProvider = TUniformSizeProvider<TValue>> -class TLRUCache: public TCache<TKey, TValue, TLRUList<TKey, TValue, TSizeProvider>, TDeleter> { +template <typename TKey, typename TValue, typename TDeleter = TNoopDelete, class TSizeProvider = TUniformSizeProvider<TValue>, typename TAllocator = std::allocator<void>> +class TLRUCache: public TCache<TKey, TValue, TLRUList<TKey, TValue, TSizeProvider>, TDeleter, TAllocator> { using TListType = TLRUList<TKey, TValue, TSizeProvider>; - typedef TCache<TKey, TValue, TListType, TDeleter> TBase; + typedef TCache<TKey, TValue, TListType, TDeleter, TAllocator> TBase; public: TLRUCache(size_t maxSize, bool multiValue = false, const TSizeProvider& sizeProvider = TSizeProvider()) @@ -708,9 +717,9 @@ public: } }; -template <typename TKey, typename TValue, typename TDeleter = TNoopDelete> -class TLFUCache: public TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter> { - typedef TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter> TBase; +template <typename TKey, typename TValue, typename TDeleter = TNoopDelete, typename TAllocator = std::allocator<void>> +class TLFUCache: public TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter, TAllocator> { + typedef TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter, TAllocator> TBase; using TListType = TLFUList<TKey, TValue>; public: @@ -733,9 +742,9 @@ public: // Least Weighted cache // discards the least weighted items first // doesn't support promotion -template <typename TKey, typename TValue, typename TWeight, typename TWeighter, typename TDeleter = TNoopDelete> -class TLWCache: public TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter> { - typedef TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter> TBase; +template <typename TKey, typename TValue, typename TWeight, typename TWeighter, typename TDeleter = TNoopDelete, typename TAllocator = std::allocator<void>> +class TLWCache: public TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter, TAllocator> { + typedef TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter, TAllocator> TBase; using TListType = TLWList<TKey, TValue, TWeight, TWeighter>; public: diff --git a/ydb/library/pdisk_io/CMakeLists.txt b/ydb/library/pdisk_io/CMakeLists.txt index 09af6c508e4..3c0d067ff56 100644 --- a/ydb/library/pdisk_io/CMakeLists.txt +++ b/ydb/library/pdisk_io/CMakeLists.txt @@ -5,7 +5,7 @@ target_link_libraries(ydb-library-pdisk_io PUBLIC contrib-libs-cxxsupp yutil tools-enum_parser-enum_serialization_runtime - AIO + AIO::aio cpp-actors-core cpp-monlib-dynamic_counters ydb-core-debug |