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 | ret = 1; | 319 | ret = 1; |
| 320 | else | 320 | else |
| 321 | if (s->output_type == TCC_OUTPUT_OBJ) { | 321 | if (s->output_type == TCC_OUTPUT_OBJ) { |
| 322 | const char *outfile = s->outfile; | 322 | if (!s->outfile) |
| 323 | if (!outfile) | 323 | s->outfile = default_outputfile(s, filename); |
| 324 | outfile = default_outputfile(s, filename); | 324 | ret = !!tcc_output_file(s, s->outfile); |
| 325 | ret = !!tcc_output_file(s, outfile); | ||
| 326 | if (!ret) { | 325 | if (!ret) { |
| 327 | /* dump collected dependencies */ | 326 | /* dump collected dependencies */ |
| 328 | if (s->gen_deps) | 327 | if (s->gen_deps) |
| 329 | gen_makedeps(s, outfile, s->deps_outfile); | 328 | gen_makedeps(s, s->outfile, s->deps_outfile); |
| 330 | if ((i+1) < s->nb_files) { | 329 | if ((i+1) < s->nb_files) { |
| 331 | tcc_delete(s); | 330 | tcc_delete(s); |
| 332 | s = tcc_new(); | 331 | s = tcc_new(); |