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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user