Skip to content

Commit 914f712

Browse files
committed
Fix warning in MSVC
1 parent 358a718 commit 914f712

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/memory_tracker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ void scramble(void* ptr, std::size_t size) {
4141
void* allocate(std::size_t size, bool array, std::align_val_t align) {
4242
if (memory_tracking && num_allocations == max_allocations) {
4343
if constexpr (debug_alloc) {
44-
std::printf("alloc %ld failed\n", size);
44+
std::printf("alloc %zu failed\n", size);
4545
}
4646
throw std::bad_alloc();
4747
}
4848

4949
if (force_next_allocation_failure) {
5050
if constexpr (debug_alloc) {
51-
std::printf("alloc %ld failed\n", size);
51+
std::printf("alloc %zu failed\n", size);
5252
}
5353
force_next_allocation_failure = false;
5454
throw std::bad_alloc();
@@ -69,13 +69,13 @@ void* allocate(std::size_t size, bool array, std::align_val_t align) {
6969

7070
if (!p) {
7171
if constexpr (debug_alloc) {
72-
std::printf("alloc %ld failed\n", size);
72+
std::printf("alloc %zu failed\n", size);
7373
}
7474
throw std::bad_alloc();
7575
}
7676

7777
if constexpr (debug_alloc) {
78-
std::printf("alloc %ld -> %p\n", size, p);
78+
std::printf("alloc %zu -> %p\n", size, p);
7979
}
8080

8181
if constexpr (scramble_alloc) {

0 commit comments

Comments
 (0)