Exemple #1
0
void
StartupLogFreeRamAndStorage()
{
  int freeram = SystemFreeRAM() / 1024;
  int freestorage = FindFreeSpace(GetPrimaryDataPath());
  LogStartUp(_T("Free ram %d; free storage %d"), freeram, freestorage);
}
Exemple #2
0
void
InfoBoxContentFreeRAM::Update(InfoBoxWindow &infobox)
{
#ifdef HAVE_MEM_INFO
  TCHAR tmp[32];
  TCHAR unit;
  unsigned long freeRAM = SystemFreeRAM();
  double f = freeRAM;
  if (freeRAM >= 1024 * 1024 *1024) {
    f /= (1024 * 1024 * 1024);
    unit = _T('G');
  } else if (freeRAM >= 1024 * 1024) {
    f /= (1024 * 1024);
    unit = _T('M');
  } else if (freeRAM >= 1024) {
    f /= 1024;
    unit = _T('K');
  } else
    unit = _T('B');
  _stprintf(tmp, _T("%.1f%c"), f, unit);
  infobox.SetValue(tmp);
#else
  infobox.SetInvalid();
#endif
}
Exemple #3
0
void
UpdateInfoBoxFreeRAM(InfoBoxData &data)
{
#ifdef HAVE_MEM_INFO
  FormatByteSize(data.value.buffer(), data.value.MAX_SIZE, SystemFreeRAM(), true);
#else
  data.SetInvalid();
#endif
}
Exemple #4
0
void
StartupLogFreeRamAndStorage()
{
#ifdef HAVE_MEM_INFO
  unsigned long freeram = SystemFreeRAM() / 1024;
  LogFormat("Free ram %lu KB", freeram);
#endif
  unsigned long freestorage = FindFreeSpace(GetPrimaryDataPath());
  LogFormat("Free storage %lu KB", freestorage);
}