www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6182] New: _d_arraycopy should take TypeInfo as final argument instead of simply element size

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182

           Summary: _d_arraycopy should take TypeInfo as final argument
                    instead of simply element size
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: schveiguy yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy yahoo.com> 2011-06-20
08:19:39 PDT ---
This allows implementation of postblit (and possibly other runtime tasks) when
array copying is done.

For example, a[] = b[] will not call any postblits on the data copied.

Once the compiler is fixed, I can generate a pull request to fix the runtime.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch
           Severity|enhancement                 |major


--- Comment #1 from timon.gehr gmx.ch 2012-02-10 12:09:34 PST ---
This is not an enhancement. postblits not being called is a clear bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182



--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-06-13 03:38:24 PDT ---
I checked this with 2.064a(fbd6c9f)

struct S
{
    static int cnt;
    this(this) { ++cnt; }
}
void main()
{
    S[3] sa1;
    S[3] sa2;
    sa1[] = sa2[];
    printf("S.cnt = %d\n", S.cnt);     // prints 3

    auto da1 = new S[](3);
    auto da2 = new S[](3);
    da1[] = da2[];
    printf("S.cnt = %d  \n", S.cnt);   // prints 6
}

Is this already fixed?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182


Peter Alexander <peter.alexander.au gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au gmail.co
                   |                            |m


--- Comment #3 from Peter Alexander <peter.alexander.au gmail.com> 2013-06-13
03:56:44 PDT ---
(In reply to comment #2)
 Is this already fixed?

It appears to have been fixed in 2.060 by yourself. It was fixed against Issue 6470. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182


Benjamin Thaut <code benjamin-thaut.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code benjamin-thaut.de


--- Comment #4 from Benjamin Thaut <code benjamin-thaut.de> 2013-06-13 06:55:06
PDT ---
(In reply to comment #2)
 
 Is this already fixed?

I just debugged it with dmd 2.063 where it is already fixed. It seems that the compiler now generates a call to _d_arrayassign as soon as the array is made of structs that have a postblit constructor or destructor. I didn't know _d_arrayassign did exist, so this bug is both fixed and invalid. _d_arraycopy was never intended to be used for complex types. _d_arrayassign exists for this purpose as far as I understand it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 13 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6182


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #5 from Steven Schveighoffer <schveiguy yahoo.com> 2013-06-13
07:29:05 PDT ---
This was a LOOONG time ago :)  Certainly possible it was fixed, and in a
different way than I asked for.  I'll close it, it seems issue 6470 was a
better solution.

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

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