[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: KMemoryInfo: system memory query
From:       "John Tapsell" <johnflux () gmail ! com>
Date:       2010-01-10 4:05:30
Message-ID: 20100110040530.29387.38646 () localhost
[Download RAW message or body]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2536/#review3621
-----------------------------------------------------------


At a quick glance, it looks like you're returning the values in bytes?
 The documentation doesn't say what the units are anywhere.

I think returning the values in kilobytes is better.

For the linux implementation you use the sysinfo function.  Any idea
how this compares, speed wise, to sysconf?

E.g. doing:
   return ((long long)sysconf(_SC_PHYS_PAGES)) * (sysconf(_SC_PAGESIZE)/1024);

etc.  This also avoids the need for an update()



- John


On 2010-01-09 23:18:46, Pino Toscano wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2536/
> -----------------------------------------------------------
> 
> (Updated 2010-01-09 23:18:46)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> KMemoryInfo is a small class used to query the OS requesting the memory (RAM) \
> information available. It is possible to selectively choose which information \
> request. The implementations provided so far are for Linux and Windows; more OSes \
> can easily be added later. The (so far small) unit test should help assuring the \
> implementation for the current OS is sane. 
> Possible users interested by this: okular and gwenview (which currently have \
> basically the same code), and maybe ksysguard/processcore, superkaramba, \
> kio_sysinfo, and kinfocenter (once KMemoryInfo reaches the number of OS \
> implementation kinfocenter has). 
> 
> Diffs
> -----
> 
> /trunk/KDE/kdelibs/kdecore/CMakeLists.txt 1072277 
> /trunk/KDE/kdelibs/kdecore/tests/CMakeLists.txt 1072277 
> /trunk/KDE/kdelibs/kdecore/tests/kmemoryinfotest.cpp PRE-CREATION 
> /trunk/KDE/kdelibs/kdecore/util/kmemoryinfo.h PRE-CREATION 
> /trunk/KDE/kdelibs/kdecore/util/kmemoryinfo.cpp PRE-CREATION 
> /trunk/KDE/kdelibs/kdecore/util/kmemoryinfo_linux.cpp PRE-CREATION 
> /trunk/KDE/kdelibs/kdecore/util/kmemoryinfo_win.cpp PRE-CREATION 
> 
> Diff: http://reviewboard.kde.org/r/2536/diff
> 
> 
> Testing
> -------
> 
> The small unit test pass, an example application as well.
> 
> 
> Thanks,
> 
> Pino
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic