\brief Return a capacity expanded by the desired growth factor
| 100 | |
| 101 | /// \brief Return a capacity expanded by the desired growth factor |
| 102 | static int64_t GrowByFactor(int64_t current_capacity, int64_t new_capacity) { |
| 103 | // Doubling capacity except for large Reserve requests. 2x growth strategy |
| 104 | // (versus 1.5x) seems to have slightly better performance when using |
| 105 | // jemalloc, but significantly better performance when using the system |
| 106 | // allocator. See ARROW-6450 for further discussion |
| 107 | return std::max(new_capacity, current_capacity * 2); |
| 108 | } |
| 109 | |
| 110 | /// \brief Append the given data to the buffer |
| 111 | /// |