Boost logo

Boost :

Subject: Re: [boost] [beast] Formal review
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2017-07-10 16:57:16

Vinnie Falco wrote:
> The utf-8 validation of text websocket message payloads is a critical
> bottleneck.

I thought I'd have a look at that. Your code has a fast-path that
attempts to check 8 bytes at a time by masking with 0x8080808080808080.
I agree that that is probably a useful optimisation which a compiler is
unlikely to apply by itself. Your implementation
) does this:

   if((*reinterpret_cast<std::size_t const*>(in) & mask) != 0)

So you're reinterpret_casting a char* to a size_t* and then dereferencing
it. Isn't that undefined behaviour?

Regards, Phil.

Boost list run by bdawes at, gregod at, cpdaniel at, john at