random C/C++ question: is there any way to implement the chunking optimization w/o violating strict aliasing?https://github.com/esmil/musl/blob/master/src/string/memcpy.c …
-
-
-
Replying to @johnregehr
@johnregehr Casting from (char*) to any other type is exempted from strict aliasing rules, right?1 reply 0 retweets 0 likes -
Replying to @BRIAN_____
@BRIAN_____ I believe you can only go to char *, not from it1 reply 0 retweets 2 likes -
Replying to @johnregehr
@johnregehr IIUC, if the thing is an "allocated object" then it can be accessed willy-nilly as the lvalue type is the effective type.2 replies 0 retweets 0 likes -
Replying to @BRIAN_____
@johnregehr But, it does seem to mean that using this optimization on anything allocated as `static` or `auto` would be UB. Hard to read.1 reply 0 retweets 1 like -
Replying to @BRIAN_____
@BRIAN_____ hmm, I can't believe that malloced memory is exempt from strict aliasing-- this would defeat almost 100% of the perf benefit3 replies 0 retweets 0 likes
@johnregehr ... other than the declared type.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.