Removed get_pageshift(). Every one can affort a * instead of a >>, no need

* glibtop_server.c:
	* glibtop_server.h:
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s): Removed get_pageshift().
	Every one can affort a * instead of a >>, no need for this kind of
	non-reentrant optimization. Saved 144B (obviously perfect cleanup ;)
This commit is contained in:
Benoît Dejean
2004-09-23 08:13:28 +00:00
parent c29887d4b0
commit 61889bc182
5 changed files with 19 additions and 32 deletions

View File

@@ -9,9 +9,6 @@
#include <fcntl.h>
/* gcc warning bug */
unsigned get_pageshift(void);
unsigned long long
get_scaled(const char *buffer, const char *key)
@@ -85,20 +82,3 @@ file_to_buffer(glibtop *server, char *buffer, const char *filename)
}
unsigned get_pageshift(void)
{
static unsigned pageshift = 0;
if(G_UNLIKELY(!pageshift))
{
register unsigned pagesize = getpagesize();
while( pagesize > 1 )
{
pagesize >>= 1;
pageshift++;
}
}
return pageshift;
}