MCPcopy Create free account
hub / github.com/crossuo/crossuo / backtrace_vector_release

Function backtrace_vector_release

external/tracy/libbacktrace/alloc.cpp:147–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145/* Release any extra space allocated for VEC. */
146
147int
148backtrace_vector_release (struct backtrace_state *state ATTRIBUTE_UNUSED,
149 struct backtrace_vector *vec,
150 backtrace_error_callback error_callback,
151 void *data)
152{
153 vec->alc = 0;
154
155 if (vec->size == 0)
156 {
157 /* As of C17, realloc with size 0 is marked as an obsolescent feature, use
158 free instead. */
159 rpfree (vec->base);
160 vec->base = NULL;
161 return 1;
162 }
163
164 vec->base = rprealloc (vec->base, vec->size);
165 if (vec->base == NULL)
166 {
167 error_callback (data, "realloc", errno);
168 return 0;
169 }
170
171 return 1;
172}
173
174}

Callers 6

backtrace_vector_finishFunction · 0.85
read_line_infoFunction · 0.85
read_function_entryFunction · 0.85
read_function_infoFunction · 0.85
build_dwarf_dataFunction · 0.85
backtrace_vector_freeFunction · 0.85

Calls 3

rpfreeFunction · 0.85
rpreallocFunction · 0.85
error_callbackFunction · 0.85

Tested by

no test coverage detected