diff options
author | Dino Viehland <dinoviehland@fb.com> | 2023-10-31 18:54:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 18:54:35 (GMT) |
commit | c42347d025b29e993a12925a3ddf58c0c9bb7f7b (patch) | |
tree | eec79ee9298f231802edcb241d37d51b8fe5f31c /Objects | |
parent | 244567398370bfa62a332676762bb1db395c02fc (diff) | |
download | cpython-c42347d025b29e993a12925a3ddf58c0c9bb7f7b.zip cpython-c42347d025b29e993a12925a3ddf58c0c9bb7f7b.tar.gz cpython-c42347d025b29e993a12925a3ddf58c0c9bb7f7b.tar.bz2 |
gh-90815: Exclude mimalloc .c files from Windows build (#111532)
* Don't include mimalloc .c's in Windows build
* Fix warnings on Windows related to mimalloc
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/obmalloc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index d230bbd..2761c77 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -2730,22 +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 = {}; + 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 |