зеркало из https://github.com/microsoft/snmalloc.git
debug_check_empty (#521)
Currently a failing debug_check_empty does not provide any information. This change allows it to print the size of the one of the allocations that has not been freed.
This commit is contained in:
Родитель
c4f31bb279
Коммит
22d7c04cb8
|
@ -893,14 +893,17 @@ namespace snmalloc
|
|||
*/
|
||||
bool debug_is_empty_impl(bool* result)
|
||||
{
|
||||
auto test = [&result](auto& queue) {
|
||||
queue.filter([&result](auto slab_metadata) {
|
||||
auto test = [&result](auto& queue, smallsizeclass_t size_class) {
|
||||
queue.filter([&result, size_class](auto slab_metadata) {
|
||||
if (slab_metadata->needed() != 0)
|
||||
{
|
||||
if (result != nullptr)
|
||||
*result = false;
|
||||
else
|
||||
error("debug_is_empty: found non-empty allocator");
|
||||
report_fatal_error(
|
||||
"debug_is_empty: found non-empty allocator: size={} ({})",
|
||||
sizeclass_to_size(size_class),
|
||||
size_class);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
@ -908,9 +911,11 @@ namespace snmalloc
|
|||
|
||||
bool sent_something = flush(true);
|
||||
|
||||
smallsizeclass_t size_class = 0;
|
||||
for (auto& alloc_class : alloc_classes)
|
||||
{
|
||||
test(alloc_class.available);
|
||||
test(alloc_class.available, size_class);
|
||||
size_class++;
|
||||
}
|
||||
|
||||
// Place the static stub message on the queue.
|
||||
|
|
Загрузка…
Ссылка в новой задаче