r2770 - trunk/varnish-cache/include
phk at projects.linpro.no
phk at projects.linpro.no
Sun Jun 22 13:46:00 CEST 2008
Author: phk
Date: 2008-06-22 13:46:00 +0200 (Sun, 22 Jun 2008)
New Revision: 2770
Modified:
trunk/varnish-cache/include/vbm.h
Log:
Polish this to the new more general usage:
Allocate smaller lumps.
Don't extend to clear bits.
Modified: trunk/varnish-cache/include/vbm.h
===================================================================
--- trunk/varnish-cache/include/vbm.h 2008-06-22 11:41:32 UTC (rev 2769)
+++ trunk/varnish-cache/include/vbm.h 2008-06-22 11:46:00 UTC (rev 2770)
@@ -38,7 +38,7 @@
*/
#define VBITMAP_TYPE unsigned /* Our preferred wordsize */
-#define VBITMAP_LUMP (32*1024) /* How many bits we alloc at a time */
+#define VBITMAP_LUMP (1024) /* How many bits we alloc at a time */
#define VBITMAP_WORD (sizeof(VBITMAP_TYPE) * 8)
#define VBITMAP_IDX(n) (n / VBITMAP_WORD)
#define VBITMAP_BIT(n) (1U << (n % VBITMAP_WORD))
@@ -88,9 +88,8 @@
vbit_clr(struct vbitmap *vb, unsigned bit)
{
- if (bit >= vb->nbits)
- vbit_expand(vb, bit);
- vb->bits[VBITMAP_IDX(bit)] &= ~VBITMAP_BIT(bit);
+ if (bit < vb->nbits)
+ vb->bits[VBITMAP_IDX(bit)] &= ~VBITMAP_BIT(bit);
}
static inline int
@@ -98,6 +97,6 @@
{
if (bit >= vb->nbits)
- vbit_expand(vb, bit);
+ return (0);
return (vb->bits[VBITMAP_IDX(bit)] & VBITMAP_BIT(bit));
}
More information about the varnish-commit
mailing list