ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/ecb.pod
(Generate patch)

Comparing libecb/ecb.pod (file contents):
Revision 1.52 by root, Sun Sep 23 22:32:33 2012 UTC vs.
Revision 1.53 by root, Wed Dec 5 16:31:27 2012 UTC

236 } 236 }
237 237
238In this case, the compiler would probably be smart enough to deduce it on 238In this case, the compiler would probably be smart enough to deduce it on
239its own, so this is mainly useful for declarations. 239its own, so this is mainly useful for declarations.
240 240
241=item ecb_restrict
242
243Expands to the C<restrict> keyword or equivalent on compilers that support
244them, and to nothing on others. Must be specified on a pointer type or
245an array index to indicate that the memory doesn't alias with any other
246restricted pointer in the same scope.
247
248Example: multiply a vector, and allow the compiler to parallelise the
249loop, because it knows it doesn't overwrite input values.
250
251 void
252 multiply (float *ecb_restrict src,
253 float *ecb_restrict dst,
254 int len, float factor)
255 {
256 int i;
257
258 for (i = 0; i < len; ++i)
259 dst [i] = src [i] * factor;
260 }
261
241=item ecb_const 262=item ecb_const
242 263
243Declares that the function only depends on the values of its arguments, 264Declares that the function only depends on the values of its arguments,
244much like a mathematical function. It specifically does not read or write 265much like a mathematical function. It specifically does not read or write
245any memory any arguments might point to, global variables, or call any 266any memory any arguments might point to, global variables, or call any

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines