impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <ger...@cloudera.org>
Subject [Impala-CR](cdh5-trunk) IMPALA-3018: Don't return NULL on zero length allocations.
Date Tue, 12 Jul 2016 20:41:09 GMT
Hello Dan Hecht,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/3601

to look at the new patch set (#2).

Change subject: IMPALA-3018: Don't return NULL on zero length allocations.
......................................................................

IMPALA-3018: Don't return NULL on zero length allocations.

FunctionContext::Allocate() and FunctionContext::AllocateLocal()
used to return NULL for zero length allocations. This makes
it hard to distinguish between allocation failures and zero
length allocations. Such confusion may lead to DCHECK failure
in the macro RETURN_IF_NULL() in debug builds or access to NULL
pointers in non-debug builds.

This change fixes the problem above by returning NULL only if
there is allocation failure. Zero-length allocations will always
return a dummy non-NULL pointer.

Change-Id: Id8c3211f4d9417f44b8018ccc58ae182682693da
---
M be/src/exprs/aggregate-functions-ir.cc
M be/src/runtime/free-pool.h
M be/src/udf/udf-test.cc
M be/src/udf/udf.cc
M testdata/workloads/functional-query/queries/QueryTest/aggregation.test
5 files changed, 28 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/01/3601/2
-- 
To view, visit http://gerrit.cloudera.org:8080/3601
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id8c3211f4d9417f44b8018ccc58ae182682693da
Gerrit-PatchSet: 2
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sailesh@cloudera.com>

Mime
View raw message