first infos on macos: memory used & free

This commit is contained in:
Jos Dehaes 2021-10-02 23:48:28 +02:00
parent 8c8139bd1d
commit fe4db7c16c
3 changed files with 199 additions and 1372 deletions

View file

@ -81,7 +81,7 @@ OBJEXT := o
#? Flags, Libraries and Includes
override REQFLAGS := -std=c++20
WARNFLAGS := -Wall -Wextra -pedantic
OPTFLAGS ?= -O2 #-ftree-loop-vectorize -flto=$(THREADS)
OPTFLAGS ?= -O2
LDCXXFLAGS := -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fexceptions $(ADDFLAGS)
override CXXFLAGS += $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
override LDFLAGS += $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
@ -89,6 +89,10 @@ INC := -I$(INCDIR) -I$(SRCDIR)
SU_USER := root
SU_GROUP := root
ifeq ($(ARCH),x86_64)
override OPTFLAGS += -ftree-loop-vectorize -flto=$(THREADS)
endif
SOURCES := $(shell find $(SRCDIR) -maxdepth 1 -type f -name *.$(SRCEXT))
SOURCES += $(shell find $(SRCDIR)/$(PLATFORM_DIR) -type f -name *.$(SRCEXT))

View file

@ -381,12 +381,13 @@ namespace Runner {
//? pthread_mutex_lock to lock thread and monitor health from main thread
thread_lock pt_lck(mtx);
if (pt_lck.status != 0) {
Global::exit_error_msg = "Exception in runner thread -> pthread_mutex_lock error id: " + to_string(pt_lck.status);
Global::thread_exception = true;
Input::interrupt = true;
stopping = true;
}
// if (pt_lck.status != 0) {
// Logger::error("exception in runner thread - set stopping");
// Global::exit_error_msg = "Exception in runner thread -> pthread_mutex_lock error id: " + to_string(pt_lck.status);
// Global::thread_exception = true;
// Input::interrupt = true;
// stopping = true;
// }
//* ----------------------------------------------- THREAD LOOP -----------------------------------------------
while (not Global::quitting) {
@ -536,6 +537,7 @@ namespace Runner {
}
catch (const std::exception& e) {
Global::exit_error_msg = "Exception in runner thread -> " + (string)e.what();
Logger::error(Global::exit_error_msg);
Global::thread_exception = true;
Input::interrupt = true;
stopping = true;
@ -850,7 +852,7 @@ int main(int argc, char **argv) {
try {
while (not true not_eq not false) {
//? Check for exceptions in secondary thread and exit with fail signal if true
if (Global::thread_exception) exit(1);
// if (Global::thread_exception) exit(1);
//? Make sure terminal size hasn't changed (in case of SIGWINCH not working properly)
term_resize();

File diff suppressed because it is too large Load diff