Commit 0b178560 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add more "volatile" to make it clear to the compiler what we mean here.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4718 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 9a7846cd
...@@ -93,18 +93,17 @@ hcb_build_bittbl(void) ...@@ -93,18 +93,17 @@ hcb_build_bittbl(void)
*/ */
struct hcb_y { struct hcb_y {
unsigned short critbit; unsigned short critbit;
unsigned char ptr; unsigned char ptr;
unsigned char bitmask; unsigned char bitmask;
uintptr_t leaf[2]; volatile uintptr_t leaf[2];
}; };
#define HCB_BIT_NODE (1<<0) #define HCB_BIT_NODE (1<<0)
#define HCB_BIT_Y (1<<1) #define HCB_BIT_Y (1<<1)
struct hcb_root { struct hcb_root {
uintptr_t origo; volatile uintptr_t origo;
unsigned cmps;
}; };
static struct hcb_root hcb_root; static struct hcb_root hcb_root;
...@@ -209,7 +208,6 @@ hcb_insert(struct hcb_root *root, struct objhead *oh, int has_lock) ...@@ -209,7 +208,6 @@ hcb_insert(struct hcb_root *root, struct objhead *oh, int has_lock)
assert(y->ptr < DIGEST_LEN); assert(y->ptr < DIGEST_LEN);
s = (oh->digest[y->ptr] & y->bitmask) != 0; s = (oh->digest[y->ptr] & y->bitmask) != 0;
assert(s < 2); assert(s < 2);
root->cmps++;
p = &y->leaf[s]; p = &y->leaf[s];
pp = *p; pp = *p;
} }
...@@ -246,7 +244,6 @@ hcb_insert(struct hcb_root *root, struct objhead *oh, int has_lock) ...@@ -246,7 +244,6 @@ hcb_insert(struct hcb_root *root, struct objhead *oh, int has_lock)
assert(y->ptr < DIGEST_LEN); assert(y->ptr < DIGEST_LEN);
s = (oh->digest[y->ptr] & y->bitmask) != 0; s = (oh->digest[y->ptr] & y->bitmask) != 0;
assert(s < 2); assert(s < 2);
root->cmps++;
p = &y->leaf[s]; p = &y->leaf[s];
} }
y2->leaf[s2] = *p; y2->leaf[s2] = *p;
...@@ -260,7 +257,7 @@ static void ...@@ -260,7 +257,7 @@ static void
hcb_delete(struct hcb_root *r, struct objhead *oh) hcb_delete(struct hcb_root *r, struct objhead *oh)
{ {
struct hcb_y *y; struct hcb_y *y;
uintptr_t *p; volatile uintptr_t *p;
unsigned s; unsigned s;
if (r->origo == hcb_r_node(oh)) { if (r->origo == hcb_r_node(oh)) {
...@@ -283,7 +280,6 @@ hcb_delete(struct hcb_root *r, struct objhead *oh) ...@@ -283,7 +280,6 @@ hcb_delete(struct hcb_root *r, struct objhead *oh)
y->leaf[1] = 0; y->leaf[1] = 0;
return; return;
} }
r->cmps++;
p = &y->leaf[s]; p = &y->leaf[s];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment