| 123 | /* Finish the current allocation on VEC. */ |
| 124 | |
| 125 | void * |
| 126 | backtrace_vector_finish (struct backtrace_state *state, |
| 127 | struct backtrace_vector *vec, |
| 128 | backtrace_error_callback error_callback, |
| 129 | void *data) |
| 130 | { |
| 131 | void *ret; |
| 132 | |
| 133 | /* With this allocator we call realloc in backtrace_vector_grow, |
| 134 | which means we can't easily reuse the memory here. So just |
| 135 | release it. */ |
| 136 | if (!backtrace_vector_release (state, vec, error_callback, data)) |
| 137 | return NULL; |
| 138 | ret = vec->base; |
| 139 | vec->base = NULL; |
| 140 | vec->size = 0; |
| 141 | vec->alc = 0; |
| 142 | return ret; |
| 143 | } |
| 144 | |
| 145 | /* Release any extra space allocated for VEC. */ |
| 146 |
no test coverage detected