Cached getpagesize().

* glibtop_private.c: (get_page_size):
	* glibtop_private.h:
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s):

	Cached getpagesize().
This commit is contained in:
Benoît Dejean
2005-07-22 19:20:39 +00:00
parent 59da1618b0
commit 4efcfb2cb3
5 changed files with 29 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
#include <stdarg.h>
#include <fcntl.h>
#include <unistd.h>
unsigned long long
@@ -129,3 +130,16 @@ get_boot_time(glibtop *server)
return boot_time;
}
size_t
get_page_size(void)
{
static size_t pagesize = 0;
if(G_UNLIKELY(!pagesize))
{
pagesize = getpagesize();
}
return pagesize;
}