This commit is contained in:
retoor 2024-11-29 06:49:48 +01:00
parent ef1a7a54b4
commit 920364cfa7

View File

@ -185,7 +185,7 @@ void *rfree(void *obj) {
char *rmalloc_lld_format(ulonglong num) { char *rmalloc_lld_format(ulonglong num) {
char res[100]; char res[100];
res[0] = 0; res[0] = 0;
sprintf(res, "%'lld", num); sprintf(res, "%lld", num);
char *resp = res; char *resp = res;
while (*resp) { while (*resp) {
if (*resp == ',') if (*resp == ',')
@ -208,7 +208,7 @@ char *rmalloc_bytes_format(int factor, ulonglong num) {
} }
char *rmalloc_stats() { char *rmalloc_stats() {
static char res[200]; static char res[300];
res[0] = 0; res[0] = 0;
setlocale(LC_NUMERIC, "en_US.UTF-8"); setlocale(LC_NUMERIC, "en_US.UTF-8");
sprintf(res, "Memory usage: %s, %s (re)allocated, %s unqiue free'd, %s in use.", rmalloc_bytes_format(0, rmalloc_total_bytes_allocated), sprintf(res, "Memory usage: %s, %s (re)allocated, %s unqiue free'd, %s in use.", rmalloc_bytes_format(0, rmalloc_total_bytes_allocated),