[PATCH 02/16] hash: remove use of VLAs for Windows built code
Morten Brørup
mb at smartsharesystems.com
Thu Apr 18 08:45:45 CEST 2024
> - int32_t positions[num_keys];
> + int32_t *positions = alloca(sizeof(int32_t) * num_keys);
A general comment, using this patch as an example...
I wonder if adding const has any effect on the compilers' optimizers:
int32_t * const positions = alloca(sizeof(int32_t) * num_keys);
Perhaps not in this specific case, but maybe elsewhere.
Especially if passing the array by reference.
We're not good at adding const and restrict to function parameters, so declaring the alloca()'d arrays const might compensate for that.
More information about the dev
mailing list