tests/util_allocator.c

changeset 775
d3f451440eef
parent 770
ed710122af44
child 814
5f9e07d3dd6c
equal deleted inserted replaced
774:4fd4e0c6107a 775:d3f451440eef
81 data->alloc_total++; 81 data->alloc_total++;
82 if (ptr == NULL) { 82 if (ptr == NULL) {
83 data->alloc_failed++; 83 data->alloc_failed++;
84 } else { 84 } else {
85 data->free_total++; 85 data->free_total++;
86 #pragma GCC diagnostic push
87 #pragma GCC diagnostic ignored "-Wuse-after-free"
86 if (!cx_testing_allocator_untrack(data, mem)) { 88 if (!cx_testing_allocator_untrack(data, mem)) {
87 data->free_failed++; 89 data->free_failed++;
88 } 90 }
91 #pragma GCC diagnostic pop
89 cx_testing_allocator_track(data, ptr); 92 cx_testing_allocator_track(data, ptr);
90 } 93 }
91 return ptr; 94 return ptr;
92 } 95 }
93 } 96 }

mercurial