[Issue 2278] Guarantee alignment of stack-allocated variables on x86
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Aug 12 10:06:49 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2278
------- Comment #4 from davidl at 126.com 2008-08-12 12:06 -------
enter & leave just simple sugar for pushing and popping ebp or whatever.
if you can do it by enter & leave , you can do it simply by replacing it with
pushing & popping ebp.
align(8) void func() // make sure the stack align to 8
{
}
void func(){} // align to 4 , this might be useful to cut the use of the stack.
align to 8 for all might result a lot stack memory unused(but i'm not sure
about this).
with instructions mentioned by W, it should be a fair enough trade-off of
runtime efficiency & stack memory usage.
--
More information about the Digitalmars-d-bugs
mailing list