On 14/07/2012 20:46, Jonas Maebe wrote:
That may actually lead to quite some troubles: if someone recompiles the RTL without
optimizations, then your class crackers also have to change that setting. And there's no
way to detect how the RTL (or in general: units containing classes you are
"cracking") has been compiled in your source code.
Actually there may be:
The cracking unit, needs both cracker classes (with and without
optimization).
If sizeof(TOptimizedCracker)=sizeof(TTheClass) then
If sizeof(TNotOptimizedCracker)=sizeof(TTheClass) then
This will however not work, if reordering happens for performance.
It could also not work, if the optimizer reorders fields, even if it
does not save space in the end. (not sure if that can happen).
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel