Re:How I Got a 2x Speedup With One Line of Code
by Scaevolus on Thursday November 14, 2013 @06:27PM
(#6736508)
Note that `ob_item[i+3]` could read past the end of the array.
[ Parent
| on HN ]
Re:How I Got a 2x Speedup With One Line of Code
by jzwinck on Thursday November 14, 2013 @06:47PM
(#6736631)
This jumped out at me too. GCC's documentation says:
Data prefetch does not generate faults if addr is invalid, but the address expression itself must be valid. For example, a prefetch of p->next does not fault if p->next is not a valid address, but evaluation faults if p is not a valid address.
This seems to make the code as presented incorrect (i.e. it results in undefined behavior).