Unified · Split
| @@ -239,7 +239,7 @@ PUB_FUNC char *tcc_strdup(const char *str) · 238 unmodified lines | ||
| 239 | 239 | return ptr; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | −PUB_FUNC void tcc_memstats(void) | |
| 242 | +PUB_FUNC void tcc_memstats(int bench) | |
| 243 | 243 | { |
| 244 | 244 | } |
| 245 | 245 | |
| @@ -400,7 +400,7 @@ PUB_FUNC char *tcc_strdup_debug(const char *str, const char *file, int line) · 154 unmodified lines | ||
| 400 | 400 | return ptr; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | −PUB_FUNC void tcc_memstats(void) | |
| 403 | +PUB_FUNC void tcc_memstats(int bench) | |
| 404 | 404 | { |
| 405 | 405 | if (mem_cur_size) { |
| 406 | 406 | mem_debug_header_t *header = mem_debug_chain; |
| @@ -414,6 +414,8 @@ PUB_FUNC void tcc_memstats(void) · 7 unmodified lines | ||
| 414 | 414 | header = header->next; |
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | + else if (bench) | |
| 418 | + fprintf(stderr, "mem_max_size= %d bytes\n", mem_max_size); | |
| 417 | 419 | } |
| 418 | 420 | |
| 419 | 421 | #undef MEM_DEBUG_MAGIC1 |
| @@ -1211,6 +1213,7 @@ LIBTCCAPI TCCState *tcc_new(void) · 791 unmodified lines | ||
| 1211 | 1213 | LIBTCCAPI void tcc_delete(TCCState *s1) |
| 1212 | 1214 | { |
| 1213 | 1215 | int i; |
| 1216 | + int bench = s1->do_bench; | |
| 1214 | 1217 | |
| 1215 | 1218 | tcc_cleanup(); |
| 1216 | 1219 | |
| @@ -1266,7 +1269,7 @@ LIBTCCAPI void tcc_delete(TCCState *s1) · 49 unmodified lines | ||
| 1266 | 1269 | |
| 1267 | 1270 | tcc_free(s1->sym_attrs); |
| 1268 | 1271 | tcc_free(s1); |
| 1269 | − tcc_memstats(); | |
| 1272 | + tcc_memstats(bench); | |
| 1270 | 1273 | } |
| 1271 | 1274 | |
| 1272 | 1275 | LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname) |
| @@ -1087,7 +1087,7 @@ PUB_FUNC char *tcc_strdup_debug(const char *str, const char *file, int line); · 1086 unmodified lines | ||
| 1087 | 1087 | #define realloc(p, s) use_tcc_realloc(p, s) |
| 1088 | 1088 | #undef strdup |
| 1089 | 1089 | #define strdup(s) use_tcc_strdup(s) |
| 1090 | −PUB_FUNC void tcc_memstats(void); | |
| 1090 | +PUB_FUNC void tcc_memstats(int bench); | |
| 1091 | 1091 | PUB_FUNC void tcc_error_noabort(const char *fmt, ...); |
| 1092 | 1092 | PUB_FUNC NORETURN void tcc_error(const char *fmt, ...); |
| 1093 | 1093 | PUB_FUNC void tcc_warning(const char *fmt, ...); |