This is quite common. The idea is to make sure the compiler can re-order
NULL checks for performance.
while(x!=NULL)
{
a+=*x;
x=x->next;
}
often unrolls better something like
y = x->next; /* This goes to memory so takes time */
v = *x; /* Ditto */
if(x==NULL) /* Hide the condition check in the latency */
break;
a+=*x;
This kind of zero page abuse works well. Mapping the zero page over it also lets
you do maths ops without checking conditions.
Nevertheless - if you are debugging you don't want this optimisation feature 8)
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/