mirror of https://github.com/xzeldon/htop.git
Changed MemoryMeter and SwapMeter to use short memory sizes
The MemoryMeter and SwapMeter now use the short GNU Coreutils style format to represent memory sizes.
This commit is contained in:
parent
abe165fe5c
commit
16d8cc7c38
|
@ -26,7 +26,7 @@ int MemoryMeter_attributes[] = {
|
||||||
|
|
||||||
static void MemoryMeter_setValues(Meter* this, char* buffer, int size) {
|
static void MemoryMeter_setValues(Meter* this, char* buffer, int size) {
|
||||||
Platform_setMemoryValues(this);
|
Platform_setMemoryValues(this);
|
||||||
snprintf(buffer, size, "%ld/%ldMB", (long int) this->values[0] / 1024, (long int) this->total / 1024);
|
snprintf(buffer, size, "%ld/%ldM", (long int) this->values[0] / 1024, (long int) this->total / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MemoryMeter_display(Object* cast, RichString* out) {
|
static void MemoryMeter_display(Object* cast, RichString* out) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ static void SwapMeter_humanNumber(char* buffer, const long int* value) {
|
||||||
|
|
||||||
static void SwapMeter_setValues(Meter* this, char* buffer, int len) {
|
static void SwapMeter_setValues(Meter* this, char* buffer, int len) {
|
||||||
Platform_setSwapValues(this);
|
Platform_setSwapValues(this);
|
||||||
snprintf(buffer, len, "%ld/%ldMB", (long int) this->values[0] / MEGABYTE, (long int) this->total / MEGABYTE);
|
snprintf(buffer, len, "%ld/%ldM", (long int) this->values[0] / MEGABYTE, (long int) this->total / MEGABYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SwapMeter_display(Object* cast, RichString* out) {
|
static void SwapMeter_display(Object* cast, RichString* out) {
|
||||||
|
|
Loading…
Reference in New Issue