Skip to content

Commit

Permalink
STAR-578 avoid copying EMPTY_STATIC_ROW to heap with offheap memtable(a…
Browse files Browse the repository at this point in the history
…pache#523) (#188)

patch by Zhao Yang; reviewed by Robert Stupp for DB-1375

Co-authored-by: Zhao Yang <[email protected]>
(cherry picked from commit d09bc66)
(cherry picked from commit 90d17f0)
(cherry picked from commit ec57374)
(cherry picked from commit 2203b38)
(cherry picked from commit aa9d44d)
  • Loading branch information
djatnieks authored and jacek-lewandowski committed Oct 18, 2022
1 parent 8984b21 commit 8920afa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public DecoratedKey applyToPartitionKey(DecoratedKey key)

public Row applyToRow(Row row)
{
if (row == null)
return null;
// If current "row" is Rows.EMPTY_STATIC_ROW, don't copy it again, as "copied_empty_static_row" != EMPTY_STATIC_ROW
if (row == null || row == Rows.EMPTY_STATIC_ROW)
return row;
return row.clone(HeapCloner.instance);
}

Expand Down

0 comments on commit 8920afa

Please sign in to comment.