Remove ThreadSafeCounter usage.
This commit is contained in:
parent
1a9c6fa51c
commit
ca8a8ad358
@ -8,7 +8,6 @@
|
||||
|
||||
#include "td/utils/logging.h"
|
||||
#include "td/utils/port/thread_local.h"
|
||||
#include "td/utils/ThreadSafeCounter.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <new>
|
||||
@ -26,20 +25,14 @@ TD_THREAD_LOCAL BufferAllocator::BufferRawTls *BufferAllocator::buffer_raw_tls;
|
||||
|
||||
std::atomic<size_t> BufferAllocator::buffer_mem;
|
||||
|
||||
static ThreadSafeCounter buffer_slice_size_;
|
||||
|
||||
int64 BufferAllocator::get_buffer_slice_size() {
|
||||
return buffer_slice_size_.sum();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BufferAllocator::track_buffer_slice(int64 size) {
|
||||
if (size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
buffer_slice_size_.add(size);
|
||||
}
|
||||
|
||||
size_t BufferAllocator::get_buffer_mem() {
|
||||
return buffer_mem;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user