
12 Jul
2010
12 Jul
'10
4:53 p.m.
Excerpts from Evan Laforge's message of Mon Jul 12 16:43:45 -0400 2010:
Yeah, that's definitely the safest and simplest. But the copying defeats the purpose of passing a pointer in the first place, which was to not have to copy the giant array just to pass it.
Well, if your C code wasn't squirreling away the pointer, you could have avoided the copy. Memory copies in C are suprisingly cheap; I'm really surprised how often I see memcpy() in high performance code (though, it may be the case that the details of the algorithm are a much more important influence on performance.) Cheers, Edward