[refactor](exceptionsafe) disallow call new method explicitly (#18830)

disallow call new method explicitly
force to use create_shared or create_unique to use shared ptr
placement new is allowed
reference https://abseil.io/tips/42 to add factory method to all class.
I think we should follow this guide because if throw exception in new method, the program will terminate.

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
This commit is contained in:
yiguolei
2023-04-21 09:13:24 +08:00
committed by GitHub
parent 5a0c1cb1b9
commit 63a76ed115
22 changed files with 98 additions and 39 deletions

View File

@ -224,7 +224,7 @@ Status VRepeatNode::push(RuntimeState* state, vectorized::Block* input_block, bo
DCHECK(!_expr_ctxs.empty());
if (input_block->rows() > 0) {
_intermediate_block.reset(new Block());
_intermediate_block = Block::create_unique();
for (auto expr : _expr_ctxs) {
int result_column_id = -1;