Skip to content

Commit

Permalink
Fix warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoV committed Oct 31, 2023
1 parent 6503fb6 commit 846b2af
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Objects/obmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2730,23 +2730,23 @@ static bool _collect_alloc_stats(
static void
py_mimalloc_print_stats(FILE *out)
{
fprintf(out, "Small block threshold = %ld, in %u size classes.\n",
fprintf(out, "Small block threshold = %zd, in %u size classes.\n",
MI_SMALL_OBJ_SIZE_MAX, MI_BIN_HUGE);
fprintf(out, "Medium block threshold = %ld\n",
fprintf(out, "Medium block threshold = %zd\n",
MI_MEDIUM_OBJ_SIZE_MAX);
fprintf(out, "Large object max size = %ld\n",
fprintf(out, "Large object max size = %zd\n",
MI_LARGE_OBJ_SIZE_MAX);

mi_heap_t *heap = mi_heap_get_default();
struct _alloc_stats stats;
memset(&stats, 0, sizeof(stats));
mi_heap_visit_blocks(heap, false, &_collect_alloc_stats, &stats);

fprintf(out, " Allocated Blocks: %ld\n", stats.allocated_blocks);
fprintf(out, " Allocated Bytes: %ld\n", stats.allocated_bytes);
fprintf(out, " Allocated Bytes w/ Overhead: %ld\n", stats.allocated_with_overhead);
fprintf(out, " Bytes Reserved: %ld\n", stats.bytes_reserved);
fprintf(out, " Bytes Committed: %ld\n", stats.bytes_committed);
fprintf(out, " Allocated Blocks: %zd\n", stats.allocated_blocks);
fprintf(out, " Allocated Bytes: %zd\n", stats.allocated_bytes);
fprintf(out, " Allocated Bytes w/ Overhead: %zd\n", stats.allocated_with_overhead);
fprintf(out, " Bytes Reserved: %zd\n", stats.bytes_reserved);
fprintf(out, " Bytes Committed: %zd\n", stats.bytes_committed);
}
#endif

Expand Down

0 comments on commit 846b2af

Please sign in to comment.