| 40 | namespace { |
| 41 | |
| 42 | int64_t DoTotalBufferSize(const ArrayData& array_data, |
| 43 | std::unordered_set<const uint8_t*>* seen_buffers) { |
| 44 | int64_t sum = 0; |
| 45 | for (const auto& buffer : array_data.buffers) { |
| 46 | if (buffer && seen_buffers->insert(buffer->data()).second) { |
| 47 | sum += buffer->size(); |
| 48 | } |
| 49 | } |
| 50 | for (const auto& child : array_data.child_data) { |
| 51 | sum += DoTotalBufferSize(*child, seen_buffers); |
| 52 | } |
| 53 | if (array_data.dictionary) { |
| 54 | sum += DoTotalBufferSize(*array_data.dictionary, seen_buffers); |
| 55 | } |
| 56 | return sum; |
| 57 | } |
| 58 | |
| 59 | int64_t DoTotalBufferSize(const Array& array, |
| 60 | std::unordered_set<const uint8_t*>* seen_buffers) { |