github-actions[bot] commented on code in PR #38519: URL: https://github.com/apache/doris/pull/38519#discussion_r1696432938
########## be/src/io/fs/s3_file_write_bufferpool.cpp: ########## @@ -29,13 +30,43 @@ namespace doris { namespace io { + +bvar::Adder<uint64_t> s3_file_buffer_allocated("s3_file_buffer_allocated"); + +template <typename Allocator = Allocator<false, false, false>> +struct Memory : boost::noncopyable, Allocator { + Memory() = default; + explicit Memory(size_t size) : _size(size) { + alloc(size); + s3_file_buffer_allocated << 1; + } + ~Memory() { + dealloc(); + s3_file_buffer_allocated << -1; + } + void alloc(size_t size) { _data = static_cast<char*>(Allocator::alloc(size, 0)); } + void dealloc() { + if (_data == nullptr) { + return; + } + Allocator::free(_data, _size); + _data = nullptr; + } + size_t _size; + char* _data; +}; + +struct S3FileBuffer::PartData { + Memory<> _memory; + PartData() : _memory(config::s3_write_buffer_size) {} Review Comment: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default] ```suggestion PartData() : _memory(config::s3_write_buffer_size) = default; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org