Skip to content

Comments

make inclusive dtor/postblit available#4650

Merged
WalterBright merged 2 commits intodlang:masterfrom
MartinNowak:aggrDtor
May 17, 2015
Merged

make inclusive dtor/postblit available#4650
WalterBright merged 2 commits intodlang:masterfrom
MartinNowak:aggrDtor

Conversation

@MartinNowak
Copy link
Member

  • attribute correct destruction and copying
  • important building blocks for manual memory management
  • replaces complex template hacks (_getPostblit, _destroyRecursive) and
    thus reduces code size and compile time b/c TypeInfo already uses them

@MartinNowak MartinNowak force-pushed the aggrDtor branch 2 times, most recently from fad589c to d7d2614 Compare May 14, 2015 18:18
- needed for attribute correct destruction of structs and classes
- same function as used by TypeInfo_Struct::xdtor
@MartinNowak
Copy link
Member Author

This is needed to finish RefCounted and Unique, please review ASAP.

Copy link
Member

Choose a reason for hiding this comment

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

huh? This is the reverse of other changes further down.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know, but I can only have one Id::postblit, and for the sake of consistency I made Id::postblit like Id::ctor to mean the native mangling.

WalterBright added a commit that referenced this pull request May 17, 2015
make inclusive dtor/postblit available
@WalterBright WalterBright merged commit 448ff39 into dlang:master May 17, 2015
@MartinNowak MartinNowak deleted the aggrDtor branch May 17, 2015 10:32
@MartinNowak
Copy link
Member Author

Thx

@JakobOvrum
Copy link

std.traits.hasElaborateCopyConstructor doesn't seem to be the same as __traits(hasMember, T, "__xpostblit"). When is __xpostblit available?

edit:

i.e. is there a case where __postblit is available but __xpostblit isn't?

@MartinNowak
Copy link
Member Author

Yes, when one of the fields has a postblit (called __fieldPostblit internally).
Same goes for __xdtor and __fieldDtor.

@MartinNowak MartinNowak added changelog_v2.068 Review:Needs Changelog A changelog entry needs to be added to /changelog labels Aug 5, 2015
wilzbach pushed a commit to wilzbach/dmd that referenced this pull request Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:Needs Changelog A changelog entry needs to be added to /changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants