Daniel Lange
8534dcb87c
Merge branch 'strace-leaks' of BenBE/htop
...
Closes #262
5 years ago
Benny Baumann
3e5bc034e5
Ensure full initialization of all fields
5 years ago
Benny Baumann
4dfedd3930
Fix various file descriptor leaks
5 years ago
Benny Baumann
c138d14897
Release old memory on error
...
Avoids leaking memory upon realloc failure.
5 years ago
Benny Baumann
5e4b182616
Combine XAlloc.[ch] into XUtils.[ch]
5 years ago
Benny Baumann
872e542f4e
Rename StringUtils.[ch] to XUtils.[ch]
6 years ago
Benny Baumann
c6f04a9c5d
Move xAsprintf, xSnprintf and xStrdup to StringUtils.h
6 years ago
Christian Göttsche
7cd093ce95
Add NetworkIOMeter
6 years ago
Christian Göttsche
a802961286
Generalize Meter value colors for IO
6 years ago
Christian Göttsche
e9246abff8
Misc Vector updates
...
- Move swap() macro to source file and implement as function
- Implement Vector_get() and Vector_size() as inline functions
to make them type safe and avoid lhs usage
- Comment comparison statistics, they are only needed for performance
testing
6 years ago
Christian Göttsche
a63cfc8b7c
Refactor generating starttime string into Process class
6 years ago
Christian Göttsche
783be7711d
Do not use extra starttime process field on Linux
6 years ago
Christian Göttsche
d744dac7ee
Add SELinuxMeter
6 years ago
Christian Göttsche
af4f58d013
Misc conversion fixes
6 years ago
Christian Göttsche
1d00893110
Automatically detect if backtrace(3) needs -lexecinfo
6 years ago
Christian Göttsche
846fe8a71f
Mark Vector parameter const for non-modifying functions
6 years ago
Christian Göttsche
3c08fa3c63
Keep building on errors
...
Doing so allows for more than one error to be detected in builds
6 years ago
Christian Göttsche
bfa7d1fbe2
Mark search parameter in Vector_indexOf const
6 years ago
Benny Baumann
2f9381d867
Keep building on errors
...
Doing so allows for more than one error to be detected in builds
6 years ago
Christian Göttsche
1df7fa387a
Misc CRT cleanup
6 years ago
Christian Göttsche
59edb2e80c
Enclose macro argument in parentheses
6 years ago
Christian Göttsche
7af06659e2
Mark remaining classes const
6 years ago
Christian Göttsche
5cc20e7cb2
Settings: do not save initial cpu count
...
Not needed and confusing with ProcessList.cpuCount
6 years ago
Christian Göttsche
9f5b50edd7
CPUMeter: avoid crashes and leaks in case the CPU count changes
...
E.g. if the HT/SMT mode changes
Use separate data for sub-meters
Do not reuse drawData for maintainability
6 years ago
Christian Göttsche
0b9a001498
Meter: use explicit type for drawData
6 years ago
Christian Göttsche
25022c219d
Read CPU count every cycle to avoid issues when HT/SMT mode changes
6 years ago
Benny Baumann
601480003f
Centralise fault handling
...
This should be done as all platforms essentially did the same anyway and there was nothing platform specific.
6 years ago
Christian Göttsche
b47bc667a2
Add key to pause process list updates
6 years ago
Christian Göttsche
fc301b7447
Compress size of default FunctionBar
6 years ago
Benny Baumann
55eafd3b39
Add conf*/ and callgrind.out.* to list of ignored files
6 years ago
Christian Göttsche
f8b9ced93f
OpenFilesScreen update
...
- Remove local types and function from header file
- Reduce OpenFiles_Data to neccessary size
- Print file access mode (r/w/u)
- Fix memory leak on consecutive items without an intermediate file item:
==15257==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 120 byte(s) in 12 object(s) allocated from:
#0 0x48c864 in strdup (htop/htop+0x48c864)
#1 0x542f68 in xStrdup htop/XAlloc.c:71:17
#2 0x50e225 in OpenFilesScreen_getProcessData htop/OpenFilesScreen.c:112:25
#3 0x50cd17 in OpenFilesScreen_scan htop/OpenFilesScreen.c:141:35
#4 0x4fd3eb in InfoScreen_run htop/InfoScreen.c:81:35
#5 0x4d58bb in actionLsof htop/Action.c:361:4
#6 0x501766 in MainPanel_eventHandler htop/MainPanel.c:80:19
#7 0x5289fa in ScreenManager_run htop/ScreenManager.c:227:19
#8 0x4f748e in main htop/htop.c:300:4
#9 0x7ff73e0d8cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: 120 byte(s) leaked in 12 allocation(s).
6 years ago
Christian Göttsche
79ad39c718
Mark Object pointer to _display function const
6 years ago
Fynn Wulf
e5fdb80c7d
Fix Hashtable_put to allow storing the same pointer
6 years ago
Christian Göttsche
f4439b1b60
Makefile sort correction
6 years ago
Christian Göttsche
41eea8a355
Mark process argument of Process_isThread const
6 years ago
Daniel Lange
7fa0f19ffd
Merge branch 'master' of https://github.com/ryenus/htop
...
Closes #223
6 years ago
ryenus
32a2caa692
use 'w' for command wrapping as 'M' is already used
...
since 'M' is already used for sort-by-memory, as with:
keys['M'] = actionSortByMemory;
reorder help info about shortcut keys
6 years ago
Benny Baumann
4a78f4bb92
Some more locations for ARRAYSIZE
6 years ago
Benny Baumann
2970cae543
Handle parsing envID & VPid from process status file
...
Fixes #55
Fixes #192
6 years ago
Christian Göttsche
ba282cfe19
Mark Object instances const
6 years ago
Christian Göttsche
08d85e6143
Mark Object classes and Object class fields const
6 years ago
Benny Baumann
164051354f
Replace copy loop by memmove in Vector_insert
...
This is basically the same change like in Vector_take,
just in the opposite direction.
6 years ago
Benny Baumann
1704c29b90
Use memmove for Vector_take
...
Doing a quick check with callgrind this gives
an average reduction from 1804 cycles/call
down to 491 cycles/call on my test system.
The average was taken over about 40k calls.
6 years ago
Daniel Lange
769df604b2
Set a -dev version to bug reports show a useful version and not the last release
6 years ago
laydervus
fbf6424e64
Option to set initial filter
...
Closes #219
6 years ago
Christian Göttsche
954d6c12f5
Simplify statm parsing and document unused fields
6 years ago
Christian Göttsche
3653ee35c5
Drop redundant cast to same type
6 years ago
Christian Göttsche
db159e7580
Enclose CLAMP macro arguments in parentheses
6 years ago
Christian Göttsche
db472075a4
Enable -Wcast-qual compiler warning
6 years ago
Christian Göttsche
ad3acfc847
Handle Panel_getSelected() returning NULL
...
Found by compiling with LTO:
ColumnsPanel.c: In function ‘ColumnsPanel_eventHandler’:
ColumnsPanel.c:46:59: error: potential null pointer dereference [-Werror=null-dereference]
46 | ((ListItem*)Panel_getSelected(super))->moving = this->moving;
| ^
AvailableColumnsPanel.c: In function ‘AvailableColumnsPanel_eventHandler’:
AvailableColumnsPanel.c:31:8: error: potential null pointer dereference [-Werror=null-dereference]
31 | int key = ((ListItem*) Panel_getSelected(super))->key;
| ^
AvailableMetersPanel.c: In function ‘AvailableMetersPanel_eventHandler’:
AvailableMetersPanel.c:40:24: error: potential null pointer dereference [-Werror=null-dereference]
40 | int param = selected->key & 0xff;
| ^
linux/IOPriorityPanel.c: In function ‘IOPriorityPanel_getIOPriority’:
linux/IOPriorityPanel.c:37:11: error: potential null pointer dereference [-Werror=null-dereference]
37 | return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key );
| ^
6 years ago