Jump to page: 1 2
Thread overview
[Issue 18084] tempCString buffer size is versioned
Dec 15, 2017
anonymous4
[Issue 18084] [REG2.072] tempCString buffer size is unittest-versioned
Dec 16, 2017
anonymous4
Dec 16, 2017
anonymous4
Apr 06, 2019
Dlang Bot
December 15, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--
December 15, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

Steven Schveighoffer <schveiguy@yahoo.com> changed:

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

--- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> ---
drat.

This was proper when it was first implemented here: https://github.com/dlang/phobos/pull/3415

But then messed up here: https://github.com/dlang/phobos/pull/4746

The original code was safe, unsure why it was undone... Will try to make a PR to restore the safe version.

--
December 15, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |

--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> ---
This isn't wrong-code, it's just a straight Phobos code bug.

--
December 15, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
PR: https://github.com/dlang/phobos/pull/5932

--
December 16, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|tempCString buffer size is  |[REG2.072] tempCString
                   |versioned                   |buffer size is
                   |                            |unittest-versioned
           Severity|critical                    |regression

--
December 16, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

--- Comment #4 from anonymous4 <dfj1esp02@sneakemail.com> ---
A variant of code:
---
//field size doesn't depend on unittest version (to avoid corruption)
//use `_buff` property to access the buffer
To[256 / To.sizeof] _buffer; // the 'small string optimization'

To[] _buff()
{
        version (unittest)
        {
                // smaller size to trigger reallocations
                return _buffer[0..16/To.sizeof];
        }
        else
        {
                return _buffer; // production size
        }
}
---
Also reallocation logic is quite smart.

--
December 16, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

--- Comment #5 from Steven Schveighoffer <schveiguy@yahoo.com> ---
This is somewhat how the original worked. I have a feeling the compiler was having difficulty proving the return wasn't a piece of the object itself, which is why the latter PR was made.

--
December 20, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/4873e2f6b3020c8edc18d4037d1f0d01a1ea6dd6 Fix issue 18084 - tempCString type should not change layout when used in unittests.

https://github.com/dlang/phobos/commit/640df9fd9cc27bba1c5a0ff445f3383dfcd7e7d2 Merge pull request #5932 from schveiguy/fix18084

Fix issue 18084 - tempCString type should not change size when used in unittests.

--
December 20, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

github-bugzilla@puremagic.com changed:

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

--
December 29, 2017
https://issues.dlang.org/show_bug.cgi?id=18084

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/4873e2f6b3020c8edc18d4037d1f0d01a1ea6dd6 Fix issue 18084 - tempCString type should not change layout when used in

https://github.com/dlang/phobos/commit/640df9fd9cc27bba1c5a0ff445f3383dfcd7e7d2 Merge pull request #5932 from schveiguy/fix18084

--
« First   ‹ Prev
1 2