8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 17:23:04 +01:00

Avoid recursive calls in memory pool printing code.

It allows to avoid stack overflow when there are huge number of extents allocated.
This commit is contained in:
hvlad 2021-01-25 11:46:19 +02:00
parent 316d107ab7
commit b8f4ae7322

View File

@ -491,9 +491,6 @@ public:
block->print_contents(block->pool == pool, file, used_only, filter_path, filter_len);
m += block->getSize();
}
if (next)
next->print_contents(file, pool, used_only, filter_path, filter_len);
}
#endif
@ -638,8 +635,6 @@ public:
fprintf(file, "Big hunk %p: memory=%p length=%" SIZEFORMAT "\n",
this, block, length);
block->print_contents(true, file, used_only, filter_path, filter_len);
if (next)
next->print_contents(file, pool, used_only, filter_path, filter_len);
}
#endif
@ -1703,8 +1698,8 @@ public:
void print_contents(FILE* file, MemPool* pool, bool used_only,
const char* filter_path, const size_t filter_len) FB_NOTHROW
{
if (currentExtent)
currentExtent->print_contents(file, pool, used_only, filter_path, filter_len);
for (Extent* ext = currentExtent; ext; ext = ext->next)
ext->print_contents(file, pool, used_only, filter_path, filter_len);
}
#endif