From 77d40f10ecc05ede24ae4f34d75f920ddf94a773 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 18 May 2008 04:17:14 +0000 Subject: [PATCH] * nscd/mem.c (markrange): Add assert to check entries are all aligned. Small cleanup in bitmap use. --- ChangeLog | 3 +++ nscd/mem.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e0ef19b9db..1aa2a36e74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-05-17 Ulrich Drepper + * nscd/mem.c (markrange): Add assert to check entries are all + aligned. Small cleanup in bitmap use. + * nscd/nscd.h (mem_in_flight): Replace blockaddr field with blockoff of type nscd_ssize_t. * nscd/mem.c (gc): Simplify markrange call for on-flight blocks. diff --git a/nscd/mem.c b/nscd/mem.c index 903f91f18b..0bcb2aaef5 100644 --- a/nscd/mem.c +++ b/nscd/mem.c @@ -79,6 +79,7 @@ static void markrange (BITMAP_T *mark, ref_t start, size_t len) { /* Adjust parameters for block alignment. */ + assert ((start & BLOCK_ALIGN_M1) == 0); start /= BLOCK_ALIGN; len = (len + BLOCK_ALIGN_M1) / BLOCK_ALIGN; @@ -93,7 +94,7 @@ markrange (BITMAP_T *mark, ref_t start, size_t len) return; } - mark[elem++] |= 0xff << (start % BITS); + mark[elem++] |= ALLBITS << (start % BITS); len -= BITS - (start % BITS); }