summaryrefslogtreecommitdiffstats
path: root/Vector.c
Commit message (Collapse)AuthorAgeFilesLines
* Use designated initializer moreChristian Göttsche2024-04-051-8/+10
| | | | | | | Designated initializers are supported in C99 and simplify struct initializations. All members not explicitly mentioned are default initialized to 0, and also modern compilers can warn on of those missing ones.
* Fix code styleBenny Baumann2023-12-261-2/+2
|
* Add includes for config.h as per the discussion in PR #1337Daniel Lange2023-12-261-0/+2
| | | | | | Many thanks to @Explorer09 Kang-Che Sung (宋岡哲). Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
* set vector slots not containing entries to NULL.Lukas Beckmann2023-04-051-7/+8
|
* resize vector in Vector_set and Vector_splice.Lukas Beckmann2023-04-051-11/+12
|
* fix some assertions in Vector_isConsistent and Vector_splice.Lukas Beckmann2023-04-051-9/+1
|
* Fix heap buffer overflow in Vector_compactBenny Baumann2022-05-101-1/+1
| | | | Fixes: #1006
* ProcessList: fix quadratic process removal when scanningCharlie Vieth2022-05-051-7/+74
| | | | | | | | | | | | | | | | | | | | | | | This commit changes ProcessList_scan to lazily remove Processes by index, which is known, instead of performing a brute-force search by pid and immediately reclaiming the lost vector space via compaction. Searching by pid is potentially quadratic in ProcessList_scan because the process we are searching for is always at the back of the vector (the scan starts from the back of the vector). Additionally, removal via Vector_remove immediately reclaims space (by sliding elements down). With these changes process removal in ProcessList_scan is now linear. Changes: * ProcessList: add new ProcessList_removeIndex function to remove by index * Vector: add Vector_softRemove and Vector_compact functions to support lazy removal/deletion of entries Vector_softRemove Vector_compact * Vector: replace Vector_count with Vector_countEquals since it only used for consistency assertions.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Avoid calling Object_isA from inside Vector_isConsistentBenny Baumann2020-11-171-6/+6
|
* Hashtable updateChristian Göttsche2020-11-171-3/+3
| | | | | | - use consistent type for key by introducing a new typedef - use unsigned types for sizes - name parameters in foreach function typedef
* Embracing branchesBenny Baumann2020-11-021-9/+23
|
* Spacing around operatorsBenny Baumann2020-11-021-6/+8
|
* Spacing after keywords (if)Benny Baumann2020-11-021-2/+2
|
* Assert Vector_get returns an objectChristian Göttsche2020-11-021-1/+2
| | | | | It is generally assumed Vector_get returns a non-NULL object. Use a generic assert in Vector_get instead of in callers.
* Drop duplicate and always true conditionChristian Göttsche2020-10-271-3/+1
| | | | This block is only entered if this->owner is true.
* Hold only a const version of Settings in ProcessListChristian Göttsche2020-10-261-3/+3
|
* Make all required includes explicitBenny Baumann2020-10-181-1/+2
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Misc Vector updatesChristian Göttsche2020-10-161-8/+17
| | | | | | | | - 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
* Mark Vector parameter const for non-modifying functionsChristian Göttsche2020-10-151-5/+5
|
* Mark search parameter in Vector_indexOf constChristian Göttsche2020-10-151-3/+3
|
* Mark Object classes and Object class fields constChristian Göttsche2020-10-071-1/+1
|
* Replace copy loop by memmove in Vector_insertBenny Baumann2020-10-071-2/+2
| | | | | This is basically the same change like in Vector_take, just in the opposite direction.
* Use memmove for Vector_takeBenny Baumann2020-10-071-2/+3
| | | | | | | | 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.
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Resolve DEBUG compilation issuesChristian Göttsche2020-10-031-31/+15
| | | | | | | Use NDEBUG conditional instead of DEBUG. Do not call static functions in extern inline ones. Vector.c:67:11: error: static function 'Vector_isConsistent' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
* minor typo in Vector.cckath2020-10-021-2/+2
|
* Drop redundant casts to the same typeChristian Göttsche2020-09-291-1/+1
|
* Clean up some code duplication in the header filesHugo Musso Gualandi2020-09-121-2/+2
| | | | | | | | | | | | | PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
* Axe automated header generation.Zev Weiss2020-09-031-19/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into ↵Nathan Scott2020-08-261-0/+12
| | | | bertwesarg-ci-hwloc-job
* Clean up existing whitespaceDaniel Flanagan2019-10-311-2/+2
|
* Optimize Vector_size on non-debug buildsHisham Muhammad2018-02-051-0/+8
|
* Check for failure in allocations.Hisham2016-02-021-3/+3
|
* Clean up some needless malloc casts, convert some mallocs to callocs, and ↵Michael McConville2015-09-161-1/+1
| | | | fix some style
* This assert is no longer valid.Hisham Muhammad2015-04-081-1/+0
|
* Complete cursor-based movement of headers.Hisham Muhammad2015-02-031-0/+4
|
* shorten scope of variable.Hisham Muhammad2014-04-211-3/+1
|
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-22/+17
| | | | UTF-8 display of big numbers.
* search and filter for the strace and lsof screens!Hisham Muhammad2012-11-101-22/+26
|
* Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad2011-12-261-2/+0
|
* major header cleanupHisham Muhammad2011-12-261-5/+6
|
* Mega-commit with features and tweaks for 1.0:Hisham Muhammad2011-11-181-9/+84
| | | | | | | | | | | * Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels.
* Tempus fugit.Hisham Muhammad2011-05-261-1/+1
|
* Fix off-by-one in Vector (the probable cause for many user-reported crashes?)Hisham Muhammad2010-11-221-2/+2
|
* expand/collapse treeHisham Muhammad2010-06-171-15/+0
|
* Tempus fugit.Hisham Muhammad2010-02-251-1/+1
|
* warning fixesHisham Muhammad2010-02-251-31/+31
|
* Clean up headers by using 'static' whenever possible.Hisham Muhammad2008-03-091-2/+10
| | | | | Reduces resulting code size.
* Add debugging sanity checks.Hisham Muhammad2006-11-121-1/+12
|

© 2014-2024 Faster IT GmbH | imprint | privacy policy