[libbacktrace] Factor out backtrace_vector_free
Factor out new function backtrace_vector_free. Bootstrapped and reg-tested on x86_64. 2018-11-30 Tom de Vries <tdevries@suse.de> * internal.h (backtrace_vector_free): New static inline fuction, factored out of ... * dwarf.c (read_line_info): ... here. From-SVN: r266658
This commit is contained in:
parent
507bdfc5f6
commit
518a3a2106
3 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2018-11-30 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* internal.h (backtrace_vector_free): New static inline fuction,
|
||||
factored out of ...
|
||||
* dwarf.c (read_line_info): ... here.
|
||||
|
||||
2018-11-28 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
|
||||
|
|
|
@ -2057,9 +2057,7 @@ read_line_info (struct backtrace_state *state, struct dwarf_data *ddata,
|
|||
return 1;
|
||||
|
||||
fail:
|
||||
vec.vec.alc += vec.vec.size;
|
||||
vec.vec.size = 0;
|
||||
backtrace_vector_release (state, &vec.vec, error_callback, data);
|
||||
backtrace_vector_free (state, &vec.vec, error_callback, data);
|
||||
free_line_header (state, hdr, error_callback, data);
|
||||
*lines = (struct line *) (uintptr_t) -1;
|
||||
*lines_count = 0;
|
||||
|
|
|
@ -257,6 +257,18 @@ extern int backtrace_vector_release (struct backtrace_state *state,
|
|||
backtrace_error_callback error_callback,
|
||||
void *data);
|
||||
|
||||
/* Free the space managed by VEC. This will reset VEC. */
|
||||
|
||||
static inline void
|
||||
backtrace_vector_free (struct backtrace_state *state,
|
||||
struct backtrace_vector *vec,
|
||||
backtrace_error_callback error_callback, void *data)
|
||||
{
|
||||
vec->alc += vec->size;
|
||||
vec->size = 0;
|
||||
backtrace_vector_release (state, vec, error_callback, data);
|
||||
}
|
||||
|
||||
/* Read initial debug data from a descriptor, and set the
|
||||
fileline_data, syminfo_fn, and syminfo_data fields of STATE.
|
||||
Return the fileln_fn field in *FILELN_FN--this is done this way so
|
||||
|
|
Loading…
Add table
Reference in a new issue