[Issue 18788] static arrays with a length specified at runtime should dynamically allocate on the stack

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 21 12:04:47 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18788

Nicholas Wilson <iamthewilsonator at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamthewilsonator at hotmail.co
                   |                            |m

--- Comment #1 from Nicholas Wilson <iamthewilsonator at hotmail.com> ---
this is the role of std.experimental.allocator.StackFront and friends (e.g.
InSituRegion), there is probably room for runtime choice of StackFront and
InSituRegion such that there is no stack allocation if the length exceeds the
InSituRegion size.

Perhaps the compiler should point users to this once it is made
non-experimental, but this should not be a language feature as it is unsafe and
may inadvertently blow the stack.

--


More information about the Digitalmars-d-bugs mailing list