3 ms·
Smart. I'm not sure how solid this is though: you would have to build the dynamic lib exactly as the static binary (same arch, subarch, optimizations, etc...).
by Ecco 12y ago
Smart. I'm not sure how solid this is though: you would have to build the dynamic lib exactly as the static binary (same arch, subarch, optimizations, etc...). Now that I think about it I'm even surprised it worked at all in his example.
- msherry 12y agoMaybe. If you're just loading constants onto the stack, it seems like it would be pretty forgiving of optimizations and such, and even work across architectures (assuming the same endian-ness, at least). I'd definitely look for init code for some calculation (as it appears the author has done here), rather than actual computation code, since, as you point out, optimizations could have a huge impact on the instructions emitted for those.