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