Thread overview
[Issue 13093] D ABI change for guaranteed efficient return of fixed size array
Jul 11, 2014
Kenji Hara
Jul 11, 2014
Kenji Hara
July 11, 2014
https://issues.dlang.org/show_bug.cgi?id=13093

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
          Component|DMD                         |websites
           Severity|enhancement                 |normal

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
It's already supported, but not explicitly described in ABI page.

>From http://dlang.org/abi

Return Value
...
* 1, 2 and 4 byte structs are returned in EAX.
* 8 byte structs are returned in EDX,EAX, where EDX gets the most significant
half.
* For other struct sizes, the return value is stored through a hidden pointer
passed as an argument to the function.
...

Normally static arrays are treated as the same size structs, so ubyte[1000] is always returned through hidden pointer.

https://github.com/D-Programming-Language/dlang.org/pull/611

--
July 11, 2014
https://issues.dlang.org/show_bug.cgi?id=13093

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
You can test it by the code.

void* p;
ubyte[10000] foo() nothrow {
    typeof(return) data;
    p = &data;
    return data;
}
void main() nothrow {
    immutable data = foo();
    assert(p == &data);
}

--
November 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13093

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/70813e9b9fe6152c83a6d24ea44080a3697a5b00
fix Issue 13093 - D ABI change for guaranteed efficient return of fixed size
array

https://github.com/D-Programming-Language/dlang.org/commit/22697d464ece7d64ba5cc2792a0863a5ffbaa88d Merge pull request #611 from 9rnsr/fix13093

Issue 13093 - D ABI change for guaranteed efficient return of fixed size array

--
November 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13093

github-bugzilla@puremagic.com changed:

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

--
February 19, 2015
https://issues.dlang.org/show_bug.cgi?id=13093

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/70813e9b9fe6152c83a6d24ea44080a3697a5b00
fix Issue 13093 - D ABI change for guaranteed efficient return of fixed size
array

https://github.com/D-Programming-Language/dlang.org/commit/22697d464ece7d64ba5cc2792a0863a5ffbaa88d Merge pull request #611 from 9rnsr/fix13093

--