aboutsummaryrefslogtreecommitdiff
path: root/nscd/mem.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-18 04:17:14 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-18 04:17:14 +0000
commit77d40f10ecc05ede24ae4f34d75f920ddf94a773 (patch)
tree2ae2d107db3a124a9c470ed63a4d05a6cf90a47d /nscd/mem.c
parent8884028c8e09ebcfb61634f212b62349606784aa (diff)
downloadglibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.tar
glibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.tar.gz
glibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.tar.bz2
glibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.zip
* nscd/mem.c (markrange): Add assert to check entries are all
aligned. Small cleanup in bitmap use.
Diffstat (limited to 'nscd/mem.c')
-rw-r--r--nscd/mem.c3
1 files changed, 2 insertions, 1 deletions
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);
}