@@ -77,20 +77,21 @@ class counting_allocatorF {
77
77
bool balanced_allocs () {
78
78
std::vector<int > temp1, temp2;
79
79
80
- std::printf (" Allocations = %lu, deallocations = %lu\n " , ca_allocs.size (), ca_deallocs.size ());
80
+ std::printf (" Allocations = %zu, deallocations = %zu\n " , ca_allocs.size (),
81
+ ca_deallocs.size ());
81
82
if (ca_allocs.size () != ca_deallocs.size ())
82
83
return false ;
83
84
84
85
temp1 = ca_allocs;
85
86
std::sort (temp1.begin (), temp1.end ());
86
87
temp2.clear ();
87
88
std::unique_copy (temp1.begin (), temp1.end (), std::back_inserter<std::vector<int >>(temp2));
88
- std::printf (" There were %lu different allocators\n " , temp2.size ());
89
+ std::printf (" There were %zu different allocators\n " , temp2.size ());
89
90
90
91
for (std::vector<int >::const_iterator it = temp2.begin (); it != temp2.end (); ++it ) {
91
92
std::ptrdiff_t const allocs = std::count (ca_allocs.begin (), ca_allocs.end (), *it);
92
93
std::ptrdiff_t const deallocs = std::count (ca_deallocs.begin (), ca_deallocs.end (), *it);
93
- std::printf (" %d: %ld vs %ld \n " , *it, allocs, deallocs);
94
+ std::printf (" %d: %td vs %td \n " , *it, allocs, deallocs);
94
95
if (allocs != deallocs)
95
96
return false ;
96
97
}
@@ -99,12 +100,12 @@ bool balanced_allocs() {
99
100
std::sort (temp1.begin (), temp1.end ());
100
101
temp2.clear ();
101
102
std::unique_copy (temp1.begin (), temp1.end (), std::back_inserter<std::vector<int >>(temp2));
102
- std::printf (" There were %lu different (de)allocators\n " , temp2.size ());
103
+ std::printf (" There were %zu different (de)allocators\n " , temp2.size ());
103
104
104
105
for (std::vector<int >::const_iterator it = ca_deallocs.begin (); it != ca_deallocs.end (); ++it ) {
105
106
std::ptrdiff_t const allocs = std::count (ca_allocs.begin (), ca_allocs.end (), *it);
106
107
std::ptrdiff_t const deallocs = std::count (ca_deallocs.begin (), ca_deallocs.end (), *it);
107
- std::printf (" %d: %ld vs %ld \n " , *it, allocs, deallocs);
108
+ std::printf (" %d: %td vs %td \n " , *it, allocs, deallocs);
108
109
if (allocs != deallocs)
109
110
return false ;
110
111
}
0 commit comments