On Tue, Jan 04, 2022 at 03:34:41PM -0800, H. S. Teoh wrote:
[...]
> Of course, afterwards the optimizer would merge them into something
> saner, but while the compiler is unfolding all those assignments, its
> memory usage would obviously skyrocket.

Or the compiler would run out of memory before it gets to optimizing
away those assignments, so it would just outright crash. I ran your code
on my computer and got this:

        uncaught exception
        core.exception.AssertError@src/dmd/common/outbuffer.d(204): OutBuffer: 
out of memory.
        ----------------
        ??:? _d_assert_msg [0x5616e935648e]
        ??:? _ZN9OutBuffer7reserveEm [0x5616e9350bda]
        ??:? nothrow @trusted void 
dmd.common.outbuffer.OutBuffer.position(ulong, ulong) [0x5616e935129c]
        ??:? _Z11ElfObj_termPKc [0x5616e933bcd6]
        Aborted

Which seems to confirm my suspicions.


T

-- 
They say that "guns don't kill people, people kill people." Well I think
the gun helps. If you just stood there and yelled BANG, I don't think
you'd kill too many people. -- Eddie Izzard, Dressed to Kill

Reply via email to