This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: obvious race condition in darwin/netbsd __enable_execute_stack due to caching pagesize/mask
Yeah that's probably ok.
Volatile is enough to force the ordering?
I still like just not caching mask.
Is "volatile*" legal or just pseudo?
Some platforms cache neither.
Are some platforms getpagesize slow and others fast?
Or it's just "random evolution"?
If it's just "random", and nobody knows getpagesize to be slow,
I'd say just never cache either.
- Jay
>
> [snip snip snip]
>
> Or even better store size after the store to mask.
> That is:
> int tmp = getpagesize();
> *(volatile*)&mask = ~((long)tmp - 1);
> *(volatile*)&size = tmp;
>
> Thanks,
> Andrew Pinski