You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "yiguolei (via GitHub)" <gi...@apache.org> on 2023/07/04 08:55:18 UTC
[GitHub] [doris] yiguolei commented on a diff in pull request #21483: [Improvement](memory) make free static for more flexible recycle
yiguolei commented on code in PR #21483:
URL: https://github.com/apache/doris/pull/21483#discussion_r1251717939
##########
be/src/vec/common/allocator.h:
##########
@@ -138,7 +145,7 @@ class Allocator {
}
/// Free memory range.
- void free(void* buf, size_t size = -1) {
Review Comment:
Better not change it to static. May have some potential bugs.
For example, the free logic is not a common free logic, it will deal with mmap, chunk allocator. If the memory is not allocated from Allocator's alloc method then the free logic is wrong.
And we do not want to this usage: Allocator::free(). All data structures that want to use this allocator has to inherit Allocator.
--
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-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org