main: print malloc() stats after disassembly in verbose mode

This commit is contained in:
Lephenixnoir 2021-03-16 13:28:47 +01:00
parent c20db6a8ca
commit fc9b292846
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 13 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include <fxos/os.h>
#include <getopt.h>
#include <malloc.h>
#include <filesystem>
#include <fstream>
@ -347,7 +348,9 @@ int main_disassembly(int argc, char **argv)
try
{
return disassembly(lib, target, ref, passes);
int rc = disassembly(lib, target, ref, passes);
if(log_getminlevel() <= LEVEL_LOG) malloc_stats();
return rc;
}
catch(LangError &e)
{

View File

@ -23,6 +23,9 @@ namespace FxOS::Log {
/* Select the log level */
void log_setminlevel(int level);
/* Get the minimum log level */
int log_getminlevel();
/* General message logger */
void logmsg(int level, char const *function, std::string message);

View File

@ -21,6 +21,12 @@ void log_setminlevel(int level)
loglevel = level;
}
/* Get the minimum log level */
int log_getminlevel()
{
return loglevel;
}
/* General message logger */
void logmsg(int level, char const *function, std::string message)
{