This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

htop r288 patch to set Memory[Bar] as (used+buffers+cache)

By: a guest on Apr 28th, 2012  |  syntax: C++  |  size: 1.14 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. *** MemoryMeter.c       2012-01-07 15:29:05.000000000 +0100
  2. --- MemoryMeter.c       2012-04-28 18:07:54.000000000 +0200
  3. ***************
  4. *** 29,40 ****
  5.      long int usedMem = this->pl->usedMem;
  6.      long int buffersMem = this->pl->buffersMem;
  7.      long int cachedMem = this->pl->cachedMem;
  8. -    usedMem -= buffersMem + cachedMem;
  9.      this->total = this->pl->totalMem;
  10.      this->values[0] = usedMem;
  11.      this->values[1] = buffersMem;
  12.      this->values[2] = cachedMem;
  13. -    snprintf(buffer, size, "%ld/%ldMB", (long int) usedMem / 1024, (long int) this->total / 1024);
  14.   }
  15.  
  16.   static void MemoryMeter_display(Object* cast, RichString* out) {
  17. --- 29,40 ----
  18.      long int usedMem = this->pl->usedMem;
  19.      long int buffersMem = this->pl->buffersMem;
  20.      long int cachedMem = this->pl->cachedMem;
  21.      this->total = this->pl->totalMem;
  22. +    snprintf(buffer, size, "%ld/%ldMB", (long int) usedMem / 1024, (long int) this->total / 1024);
  23. +    usedMem -= buffersMem + cachedMem;
  24.      this->values[0] = usedMem;
  25.      this->values[1] = buffersMem;
  26.      this->values[2] = cachedMem;
  27.   }
  28.  
  29.   static void MemoryMeter_display(Object* cast, RichString* out) {
clone this paste RAW Paste Data