Thread overview
[Issue 4881] New: _d_arrayliteralT() called in instances where a blit should suffice
Sep 17, 2010
Sean Kelly
Sep 17, 2010
nfxjfg@gmail.com
Sep 17, 2010
nfxjfg@gmail.com
Feb 02, 2012
yebblies
Oct 24, 2013
Denis Shelomovskij
September 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4881

           Summary: _d_arrayliteralT() called in instances where a blit
                    should suffice
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: sean@invisibleduck.org


--- Comment #0 from Sean Kelly <sean@invisibleduck.org> 2010-09-17 14:01:11 PDT ---
The following code will generate a call to _d_arrayliteralT() for the struct
copy operation:


import core.stdc.stdlib;

struct List {}

struct GC
{
    List*[1] free_list;
}

void main()
{
    auto gc = cast(GC*) malloc(GC.sizeof);
    *gc = GC.init; // _d_arrayliteralT() called here
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4881


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg@gmail.com


--- Comment #1 from nfxjfg@gmail.com 2010-09-17 14:31:35 PDT ---
Probably a duplicate of bug 2356 or bug 4397.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4881


Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com


--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> 2010-09-17 15:01:48 PDT ---
It might be related but it's not a dup, because in those bugs, you actually are using array literals.  I don't see any array literal's in Sean's example.  In fact, there's no dynamic arrays anywhere.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4881



--- Comment #3 from nfxjfg@gmail.com 2010-09-17 15:24:43 PDT ---
There are no array literals in bug 4397 either. But maybe the same underlying cause because there seems to be something REALLY wrong how the compiler handles initializing structs with arrays in it, or array initialization.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4881



--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> 2010-09-17 15:33:49 PDT ---
const cX = X([1,2]);

that [1,2] sure looks like a literal to me...

Legitimately, you could say the compiler should be able to call _d_arrayliteralT once to initialize cX, but not call it every time cX is used.

But I think it's different than this bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4881


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #5 from yebblies <yebblies@gmail.com> 2012-02-02 15:34:11 EST ---
*** This issue has been marked as a duplicate of issue 2356 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4881


Denis Shelomovskij <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg@gmail.com


--- Comment #6 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-10-25 00:24:40 MSD ---
This is now a duplicate of Issue 11345 because of fixing Issue 11238.

*** This issue has been marked as a duplicate of issue 11345 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------