-
-
Notifications
You must be signed in to change notification settings - Fork 422
Conversation
… functions. New interface is safer. Also it fixes bug in `_d_arraycopy` where buffer was too small for 64 bit `size_t`.
New interface is safer. Also it fixes bug in `_d_arrayctor` which didn't check for array overlap.
Since when is |
|
I like some parts of this pull request, others not so much. In any case it's quite a lot of different stuff for one pull.
|
By definition. According to Function Parameters "
As
It also gains friendly API for runtime developers and performance improvement. How much exactly do we loose on template bloat? |
It's not so bad, I've seen a few 10kBs. But if the pull was separately we could audit for possible savings. |
It isn't of utmost importance right now because the array functions are X86 desktop only. |
|
Formatting commit excluded. I'd like also |
|
LGTM, waiting for Autotester. |
|
Wanna try auto the new auto-merging feature? (checkout my email to dmd-internal and phobos) |
Yep I did, it just so happens that it was the next mail. |
Works 👍. |
Opened #662. |
Also the compiler doesn't respect docs and e.g. allocates closures when |
|
Hm, what was the rationale for moving towards always checking array op validity (also in release builds)? |
The current extern(C) interface doesn't allow to distinguish debug and release builds. |
|
Possible regression: https://issues.dlang.org/show_bug.cgi?id=14783 Does this PR add overlap checking functionality or refactor existing one? If the latter, the refactoring introduced a regression. |
It's an enhancement, not a regression.
This pull fixes overlap checking. Previously cases like |
I tested multiple D versions and in none of them did this code raise an error in non-release mode. |
As you see in a6aa6ee, there were some checks, but only in debug build of a runtime. Also "cases like" doesn't mean this particular case, maybe for this exact type and this exact operator the check weren't even present in precondition block. |
|
Regression or not applies to the final effect, not the nature of the change. If the checks were in a debug-only build of Druntime, they were effectively not there at all as we don't ship a debug runtime and almost no one builds one for themselves. If a well-intended and generally correct change broke valid code, it's still a regression. See issue discussion for whether this code is valid or not? |
This code is not valid. Overlapping operations are not supported. |
|
OK. |
As a result of safer interface few bugs are fixed and the ground is prepared for type-safe console output in druntime without calling any C I/O routines.