Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Translate _d_arraysetlengthT to template#2656

Merged
dlang-bot merged 1 commit intodlang:masterfrom
Vild:ConvertArraySetLength
Jul 2, 2019
Merged

Translate _d_arraysetlengthT to template#2656
dlang-bot merged 1 commit intodlang:masterfrom
Vild:ConvertArraySetLength

Conversation

@Vild
Copy link
Contributor

@Vild Vild commented Jun 28, 2019

dmd PR: dlang/dmd#10106

rt.array.capacity._d_arraysetlengthT will call the _d_arraysetlength{,iT} depending on if T is zero initialized, this logic used to be inside of dmd.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Vild! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2656"

*/
Tarr _d_arraysetlengthT(Tarr : T[], T)(return scope ref Tarr arr, size_t newlength) @trusted
{
version (D_BetterC)
Copy link
Contributor

@JinShil JinShil Jun 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to figure out why this check is necessary, but I haven't succeeded yet. It shouldn't be required, but this check is a successful workaround. Until I can figure it out, please use D_TypeInfo instead of D_BetterC. I think GDC does not support betterC, but instead has individual flags like -fno-rtti, -fno-exceptions, etc. Using the more specific version specifier should make this code more portable. The error message would also need to be updated e.g. "Cannot resize arrays if compiling without support for runtime type information."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will do the same changes on the other PRs.

@Vild Vild force-pushed the ConvertArraySetLength branch from 50c4fdd to d95b906 Compare June 29, 2019 22:16
@jpf91
Copy link
Contributor

jpf91 commented Jun 30, 2019

LGTM

@Vild Vild force-pushed the ConvertArraySetLength branch from d95b906 to 53764aa Compare June 30, 2019 21:01
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
@Vild Vild force-pushed the ConvertArraySetLength branch from 53764aa to 3478600 Compare June 30, 2019 21:43
@Vild
Copy link
Contributor Author

Vild commented Jun 30, 2019

timelimit: sending warning signal 15
posix.mak:395: recipe for target 'unittest/std/datetime/systime.run' failed
gmake: *** [unittest/std/datetime/systime.run] Error 143

I don't think this auto-tester error have anything to do with my changes.

@thewilsonator
Copy link
Contributor

This good to go?

@Vild
Copy link
Contributor Author

Vild commented Jul 1, 2019

This good to go?

Yes! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants