3 ms·
> There does not appear to be a way to tell gcc that it can cache the result of compound_head() Isn't this what __attribute__((pure)) [0] is for? [0] https://
by account42 5y ago
> There does not appear to be a way to tell gcc that it can cache the result of compound_head()
Isn't this what __attribute__((pure)) [0] is for?
[0] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...
- hyperman1 5y agoAs I understood it, pure means a function's output is dependent only on its input: y=f(x);z=f(x) implies y=z What they want is something different: y= f(x) implies y=f(y) This means if you give something the head of a list of pages, it won't try to go to the head again and again, it knows its already there. The 'folio' idea as I understand it is roughly an alias for the existing 'page' structure, but code knows it is already at a head AND it should do the work on the whole list, not only on the head.