[fpc-pascal] const parameter writeable

list at moz.geek.nz list at moz.geek.nz
Mon May 1 08:22:13 CEST 2006


Michael says:
> - 'const': gives pointer, content read-only

In practice the compiler may[1] check for access to the value at compile
time and just give you a pointer to the real thing (since it knows you
won't change it). With a non-specified parameter it has to make a copy and
pass that, which slows everything down. Especially for big parameters, and
you shouldn't pass big structs around for that reason.

Moz
[1] I assume FPC does this, but don't know for sure.




More information about the fpc-pascal mailing list