Skip to content

Commit

Permalink
PARQUET-739: Don't use a static buffer for data accessed by multiple …
Browse files Browse the repository at this point in the history
…threads

This buffer is used in multiple threads, so it cannot be static. It's small enough to just have it on the stack. I could add a vector to the RleDecoder class as well if you prefer

Author: fscheibner <[email protected]>

Closes apache#175 from flode/static and squashes the following commits:

9876c31 [fscheibner] Don't use a static buffer for data accessed by multiple threads

Change-Id: I02882e98a517fba882fd61f7ed3388ee255fe862
  • Loading branch information
flode authored and wesm committed Oct 10, 2016
1 parent 20d4a17 commit 408d788
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/parquet/util/rle-encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ inline int RleDecoder::GetBatchWithDict(
std::min(batch_size - values_read, static_cast<int>(literal_count_));

const int buffer_size = 1024;
static int indices[buffer_size];
int indices[buffer_size];
literal_batch = std::min(literal_batch, buffer_size);
int actual_read = bit_reader_.GetBatch(bit_width_, &indices[0], literal_batch);
DCHECK_EQ(actual_read, literal_batch);
Expand Down

0 comments on commit 408d788

Please sign in to comment.