about summary refs log tree commit diff
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
parent8884028c8e09ebcfb61634f212b62349606784aa (diff)
downloadglibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.tar.gz
glibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.tar.xz
glibc-77d40f10ecc05ede24ae4f34d75f920ddf94a773.zip
* nscd/mem.c (markrange): Add assert to check entries are all
	aligned.  Small cleanup in bitmap use.
-rw-r--r--ChangeLog3
-rw-r--r--nscd/mem.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e0ef19b9db..1aa2a36e74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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
 	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);
     }