char buffer[424242] = {0};
Is buffer[index]
as fast as *buffer
?
for (int i = 0; i < SIZE; ++i) {
buffer[i] = 42;
}
char* end = buffer + SIZE;
for (char* pos = buffer; pos != end; ++pos) {
*pos = 42;
}
I guess my question is, is there any assembly instruction that can set a position in memory plus and offset to a given value in a single cycle?
LEA seems to load the address plus multiply it in this way.