Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Fix memory statistics display on FreeBSD/powerpc #871

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix memory statistics display on FreeBSD/powerpc #871

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 24, 2018

Use the appropriate types when calling sysctl().

Currently, unsigned long long int is used for all sizes and on
FreeBSD/powerpc this causes all sysctl() calls in scanMemoryInfo()
to fail as they are actually of different sizes on powerpc, where
(sizeof(unsigned long long int), sizeof(u_long)) == (8, 4)
vs (8, 8) on amd64. This results in bogus memory sizes being
reported by htop.

Signed-off-by: Tobias Kortkamp tobik@FreeBSD.org

LionNatsu and others added 5 commits August 25, 2018 10:15
Introduced from 3383d8e (2.0.0) but never used.
The for loop already handles i being < nPanels

Raised by cppcheck
Unsigned numbers should be using "%u".

Raised by cppcheck
Use the appropriate types when calling sysctl().

Currently, `unsigned long long int` is used for all sizes and on
FreeBSD/powerpc this causes all sysctl() calls in scanMemoryInfo()
to fail as they are actually of different sizes on powerpc, where
(sizeof(unsigned long long int), sizeof(u_long)) == (8, 4)
vs (8, 8) on amd64.  This results in bogus memory sizes being
reported by htop.

Signed-off-by: Tobias Kortkamp <tobik@FreeBSD.org>
@ghost
Copy link
Author

ghost commented Dec 24, 2018

@natoscott
Copy link
Collaborator

Merged here: htop-dev/htop@ed2b779

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants