fellow_log: Polish happy bitfield update

With the previous code, the compiler could have produced machine code
which produced a transient zero lsb when in fact it should have been 1.

Ref ba32426c
Ref #66
parent a54898e3
......@@ -716,6 +716,7 @@ void
fellow_fd_update_stats(struct fellow_fd *ffd)
{
buddy_t *buddy;
uint64_t happy;
size_t sz;
CHECK_OBJ_NOTNULL(ffd, FELLOW_FD_MAGIC);
......@@ -735,8 +736,10 @@ fellow_fd_update_stats(struct fellow_fd *ffd)
ffd->stats->g_mem_space = sz;
ffd->stats->g_mem_bytes = buddy_size(buddy) - sz;
ffd->stats->b_happy <<= 1;
ffd->stats->b_happy |= !! fellow_is_open(ffd); //lint !e514
happy = ffd->stats->b_happy;
happy <<= 1;
happy |= !! fellow_is_open(ffd); //lint !e514
ffd->stats->b_happy = happy;
}
static void
......
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