A new version of the MEM_DEBUG will be submitted next. This version is not depend on the malloc_usable_size() presense in the libc and print a places where a leaked chunks of memory was allocated.
Unified · Split
| @@ -319,14 +319,13 @@ int main(int argc, char **argv) · 318 unmodified lines | ||
| 319 | 319 | ret = 1; |
| 320 | 320 | else |
| 321 | 321 | if (s->output_type == TCC_OUTPUT_OBJ) { |
| 322 | − const char *outfile = s->outfile; | |
| 323 | − if (!outfile) | |
| 324 | − outfile = default_outputfile(s, filename); | |
| 325 | − ret = !!tcc_output_file(s, outfile); | |
| 322 | + if (!s->outfile) | |
| 323 | + s->outfile = default_outputfile(s, filename); | |
| 324 | + ret = !!tcc_output_file(s, s->outfile); | |
| 326 | 325 | if (!ret) { |
| 327 | 326 | /* dump collected dependencies */ |
| 328 | 327 | if (s->gen_deps) |
| 329 | − gen_makedeps(s, outfile, s->deps_outfile); | |
| 328 | + gen_makedeps(s, s->outfile, s->deps_outfile); | |
| 330 | 329 | if ((i+1) < s->nb_files) { |
| 331 | 330 | tcc_delete(s); |
| 332 | 331 | s = tcc_new(); |