@johnregehr Casting from (char*) to any other type is exempted from strict aliasing rules, right?
-
-
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 -
Replying to @johnregehr
@johnregehr The rules for converting pointers to different types are also relevant, AFAICT.1 reply 0 retweets 0 likes -
Replying to @BRIAN_____
@johnregehr Never mind, I think I'm wrong. I think, indeed, you cannot do the chunking optimization in strict ISO C, in general.2 replies 0 retweets 0 likes -
Replying to @BRIAN_____
@BRIAN_____@johnregehr What precisely is the chunking optimization?1 reply 0 retweets 0 likes -
Replying to @sevenps
@sevenps@BRIAN_____ faster memcpy etc. using 8-byte (or whatever) chunks1 reply 0 retweets 0 likes -
Replying to @johnregehr
@johnregehr@BRIAN_____ As far as I can tell something like this doesn't violate anything and does what you expect: http://goo.gl/s8RpkT4 replies 0 retweets 3 likes
@sevenps @johnregehr In order to hit the UB, you need to also have code that reads from the result of memcpy2. UB is in reading not writing.
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.