| 56 | private: |
| 57 | template <typename Call> |
| 58 | arrow::Status GcAndTryAgain(const Call& call) { |
| 59 | if (call().ok()) { |
| 60 | return arrow::Status::OK(); |
| 61 | } else { |
| 62 | // ARROW-10080: Allocation may fail spuriously since the garbage collector is lazy. |
| 63 | // Force it to run then try again in case any reusable allocations have been freed. |
| 64 | arrow::Status r_call = SafeCallIntoRVoid([] { |
| 65 | cpp11::function gc = cpp11::package("base")["gc"]; |
| 66 | gc(); |
| 67 | }); |
| 68 | ARROW_RETURN_NOT_OK(r_call); |
| 69 | return call(); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | arrow::MemoryPool* pool_; |
| 74 | }; |
nothing calls this directly
no test coverage detected