Original Post
🔒 Locked
About inline functions.
Advertisement
I think that would be up to the compiler, but it would be best for it to compile to nothing I would hope.
// God.c
void main() {
WORLD Earth;
LIFE People = Earth.CreateLife(HUMAN);
GiveHope(&People);
delete Earth;
EvilCackle();
}
// God.c
void main() {
WORLD Earth;
LIFE People = Earth.CreateLife(HUMAN);
GiveHope(&People);
delete Earth;
EvilCackle();
}
thats dependent on the compiler,
but,
i think that most compilers would not allot any space for that function address, and therefore not call it, in essece accidentally optimizing it out.
though it could be possible for the compiler to cause an overlap, so that when you called donothing, you would actually call some other function. compilers are usually smarter than this though.
but,
i think that most compilers would not allot any space for that function address, and therefore not call it, in essece accidentally optimizing it out.
though it could be possible for the compiler to cause an overlap, so that when you called donothing, you would actually call some other function. compilers are usually smarter than this though.
If it wasn''t inline, then it might count as a function call under a non-optimising compiler, but since it''s inline, it won''t, even in the most braindead compiler.
If you want to waste CPU cycles, you could just throw in:
__asm { nop };
...which shouldn''t get optimised out.
If you want to waste CPU cycles, you could just throw in:
__asm { nop };
...which shouldn''t get optimised out.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement