Skip to content

Commit bfc415a

Browse files
committed
Fix stl
1 parent 098b1c4 commit bfc415a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/snmalloc/ds_core/stats.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace snmalloc
1919
void increase(size_t amount)
2020
{
2121
size_t c = (curr += amount);
22-
size_t p = peak.load(std::memory_order_relaxed);
22+
size_t p = peak.load(stl::memory_order_relaxed);
2323
while (c > p)
2424
{
2525
if (peak.compare_exchange_strong(p, c))
@@ -37,12 +37,12 @@ namespace snmalloc
3737

3838
size_t get_curr()
3939
{
40-
return curr.load(std::memory_order_relaxed);
40+
return curr.load(stl::memory_order_relaxed);
4141
}
4242

4343
size_t get_peak()
4444
{
45-
return peak.load(std::memory_order_relaxed);
45+
return peak.load(stl::memory_order_relaxed);
4646
}
4747

4848
void operator+=(size_t amount)
@@ -71,28 +71,28 @@ namespace snmalloc
7171
*/
7272
class MonotoneLocalStat
7373
{
74-
std::atomic<size_t> value{0};
74+
stl::Atomic<size_t> value{0};
7575

7676
public:
7777
void operator++(int)
7878
{
79-
value.fetch_add(1, std::memory_order_relaxed);
79+
value.fetch_add(1, stl::memory_order_relaxed);
8080
}
8181

8282
void operator+=(const MonotoneLocalStat& other)
8383
{
84-
auto v = other.value.load(std::memory_order_relaxed);
85-
value.fetch_add(v, std::memory_order_relaxed);
84+
auto v = other.value.load(stl::memory_order_relaxed);
85+
value.fetch_add(v, stl::memory_order_relaxed);
8686
}
8787

8888
void operator+=(size_t v)
8989
{
90-
value.fetch_add(v, std::memory_order_relaxed);
90+
value.fetch_add(v, stl::memory_order_relaxed);
9191
}
9292

9393
size_t operator*()
9494
{
95-
return value.load(std::memory_order_relaxed);
95+
return value.load(stl::memory_order_relaxed);
9696
}
9797
};
9898
} // namespace snmalloc

src/snmalloc/global/globalalloc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ namespace snmalloc
147147
template<SNMALLOC_CONCEPT(IsConfig) Config_ = Config>
148148
inline static void print_alloc_stats()
149149
{
150-
static std::atomic<size_t> dump{0};
150+
static stl::Atomic<size_t> dump{0};
151151

152152
auto l_dump = dump++;
153153
if (l_dump == 0)

src/snmalloc/mem/pool.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ namespace snmalloc
3232

3333
FlagWord lock{};
3434
capptr::Alloc<T> list{nullptr};
35-
std::atomic<size_t> count{0};
35+
stl::Atomic<size_t> count{0};
3636

3737
public:
3838
constexpr PoolState() = default;
3939

4040
size_t get_count()
4141
{
42-
return count.load(std::memory_order_relaxed);
42+
return count.load(stl::memory_order_relaxed);
4343
}
4444
};
4545

0 commit comments

Comments
 (0)