* nscd/mem.c (markrange): Add assert to check entries are all

aligned.  Small cleanup in bitmap use.
This commit is contained in:
Ulrich Drepper 2008-05-18 04:17:14 +00:00
parent 8884028c8e
commit 77d40f10ec
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2008-05-17 Ulrich Drepper <drepper@redhat.com> 2008-05-17 Ulrich Drepper <drepper@redhat.com>
* 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 * nscd/nscd.h (mem_in_flight): Replace blockaddr field with
blockoff of type nscd_ssize_t. blockoff of type nscd_ssize_t.
* nscd/mem.c (gc): Simplify markrange call for on-flight blocks. * nscd/mem.c (gc): Simplify markrange call for on-flight blocks.

View File

@ -79,6 +79,7 @@ static void
markrange (BITMAP_T *mark, ref_t start, size_t len) markrange (BITMAP_T *mark, ref_t start, size_t len)
{ {
/* Adjust parameters for block alignment. */ /* Adjust parameters for block alignment. */
assert ((start & BLOCK_ALIGN_M1) == 0);
start /= BLOCK_ALIGN; start /= BLOCK_ALIGN;
len = (len + BLOCK_ALIGN_M1) / BLOCK_ALIGN; len = (len + BLOCK_ALIGN_M1) / BLOCK_ALIGN;
@ -93,7 +94,7 @@ markrange (BITMAP_T *mark, ref_t start, size_t len)
return; return;
} }
mark[elem++] |= 0xff << (start % BITS); mark[elem++] |= ALLBITS << (start % BITS);
len -= BITS - (start % BITS); len -= BITS - (start % BITS);
} }