[Issue 12820] DMD can inline calls to functions that use alloca, allocating the memory in the caller function instead.
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 24 09:26:37 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12820
--- Comment #3 from yebblies <yebblies at gmail.com> ---
(In reply to Orvid King from comment #1)
> I believe that the issue here is not that DMD inlines alloca (which it
> should)
> but instead that it fails to recognize that the memory allocated by alloca
> should be released at the end of the scope's body.
alloca is defined to release memory at the end of the calling function.
Releasing memory early would require a different variant of alloca, and while
possible, this is difficult. Since the inliner can't do this conversion, it
shouldn't be inlining alloca.
--
More information about the Digitalmars-d-bugs
mailing list