mirror of
https://github.com/aristocratos/btop.git
synced 2024-09-27 22:01:29 +02:00
first infos on macos: memory used & free
This commit is contained in:
parent
8c8139bd1d
commit
fe4db7c16c
6
Makefile
6
Makefile
@ -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))
|
||||
|
16
src/btop.cpp
16
src/btop.cpp
@ -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
Loading…
Reference in New Issue
Block a user