From: albert <> Date: Sun, 13 Oct 2002 21:19:26 +0000 (+0000) Subject: alignment & size X-Git-Tag: v3.3.0~412 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91cf8f1c8830a7a5f7edbdd719eaa7e501f413d0;p=procps-ng alignment & size --- diff --git a/proc/pwcache.c b/proc/pwcache.c index a8c34a65..c8bb18c9 100644 --- a/proc/pwcache.c +++ b/proc/pwcache.c @@ -13,16 +13,18 @@ #include "procps.h" #include -#define HASHSIZE 16 /* power of 2 */ +// might as well fill cache lines... else we waste memory anyway + +#define HASHSIZE 32 /* power of 2 */ #define HASH(x) ((x) & (HASHSIZE - 1)) -#define NAMESIZE 16 -#define NAMELENGTH "15" +#define NAMESIZE 20 +#define NAMELENGTH "19" static struct pwbuf { + struct pwbuf *next; uid_t uid; char name[NAMESIZE]; - struct pwbuf *next; } *pwhash[HASHSIZE]; char *user_from_uid(uid_t uid) @@ -47,9 +49,9 @@ char *user_from_uid(uid_t uid) } static struct grpbuf { + struct grpbuf *next; gid_t gid; char name[NAMESIZE]; - struct grpbuf *next; } *grphash[HASHSIZE]; char *group_from_gid(gid_t gid)