Try to prevent reallocs when building kernel symbols table.

% wc -l /proc/kallsyms
419362 /proc/kallsyms
This commit is contained in:
Bartosz Taudul 2024-05-25 15:42:13 +02:00
parent 56b4424399
commit d5064aa8ea
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -795,7 +795,7 @@ static void InitKernelSymbols()
{
FILE* f = fopen( "/proc/kallsyms", "rb" );
if( !f ) return;
tracy::FastVector<KernelSymbol> tmpSym( 1024 );
tracy::FastVector<KernelSymbol> tmpSym( 512 * 1024 );
size_t linelen = 16 * 1024; // linelen must be big enough to prevent reallocs in getline()
auto linebuf = (char*)tracy_malloc( linelen );
ssize_t sz;