Merge 10.6 into 10.11

This commit is contained in:
Marko Mäkelä 2024-05-30 16:04:00 +03:00
commit 22ba7e4ff8
111 changed files with 1451 additions and 296 deletions

View file

@ -212,7 +212,7 @@ void Json_writer::add_ull(ulonglong val)
}
/* Add a memory size, printing in Kb, Kb, Gb if necessary */
/* Add a memory size, printing in Kb, Mb if necessary */
void Json_writer::add_size(longlong val)
{
char buf[64];
@ -220,18 +220,10 @@ void Json_writer::add_size(longlong val)
if (val < 1024)
len= my_snprintf(buf, sizeof(buf), "%lld", val);
else if (val < 1024*1024*16)
{
/* Values less than 16MB are specified in KB for precision */
len= my_snprintf(buf, sizeof(buf), "%lld", val/1024);
strcpy(buf + len, "Kb");
len+= 2;
}
len= my_snprintf(buf, sizeof(buf), "%lldKb", val/1024);
else
{
len= my_snprintf(buf, sizeof(buf), "%lld", val/(1024*1024));
strcpy(buf + len, "Mb");
len+= 2;
}
len= my_snprintf(buf, sizeof(buf), "%lldMb", val/(1024*1024));
add_str(buf, len);
}