Skip to content

Commit 84f7474

Browse files
committed
std::atomic
commit_hash:be10606b22b15d660282895983c88ae5a0db0be9
1 parent c1f4e6b commit 84f7474

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

yql/essentials/minikql/aligned_page_pool.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "aligned_page_pool.h"
22
#include "util/string/builder.h"
3-
#include <contrib/ydb/library/actors/util/intrinsics.h>
43

54
#include <util/generic/yexception.h>
65
#include <util/string/cast.h>
@@ -49,15 +48,15 @@ class TGlobalPagePool {
4948
void* GetPage() {
5049
void *page = nullptr;
5150
if (Pages.Dequeue(&page)) {
52-
AtomicDecrement(Count);
51+
--Count;
5352
return page;
5453
}
5554

5655
return nullptr;
5756
}
5857

5958
ui64 GetPageCount() const {
60-
return RelaxedLoad(&Count);
59+
return Count.load(std::memory_order_relaxed);
6160
}
6261

6362
size_t GetPageSize() const {
@@ -75,7 +74,7 @@ class TGlobalPagePool {
7574
FreePage(addr);
7675
return GetPageSize();
7776
#else
78-
AtomicIncrement(Count);
77+
++Count;
7978
Pages.Enqueue(addr);
8079
return 0;
8180
#endif
@@ -88,7 +87,7 @@ class TGlobalPagePool {
8887

8988
private:
9089
const size_t PageSize;
91-
TAtomic Count = 0;
90+
std::atomic<ui64> Count = 0;
9291
TLockFreeStack<void*> Pages;
9392
};
9493

yql/essentials/minikql/ya.make

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ SRCS(
5555
PEERDIR(
5656
contrib/libs/apache/arrow
5757
contrib/libs/cctz/tzdata
58-
contrib/ydb/library/actors/util
5958
library/cpp/deprecated/enum_codegen
6059
library/cpp/enumbitset
6160
library/cpp/monlib/dynamic_counters

0 commit comments

Comments
 (0)