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

Conversation

@MartinNowak
Copy link
Member

No description provided.

@andralex
Copy link
Member

Risky but efficient.

andralex added a commit that referenced this pull request Jan 15, 2015
don't reset memory of finalized classes/structs/arrays
@andralex andralex merged commit 8fffa42 into dlang:master Jan 15, 2015
@MartinNowak MartinNowak deleted the fixup864 branch January 15, 2015 20:42
@MartinNowak
Copy link
Member Author

Risky but efficient.

Rather not, because it was freed by the GC. And when the men is allocated again you hopefully don't forget to initialize it ;).
We already did it for classes, so this just applies existing behavior to structs and writing to all the reclaimed memory is extremely expensive.

@schveiguy
Copy link
Member

finalize_array2 is called by GC, finalize_array I believe is still called by doing delete arr (haven't verified this)

That being said, I still think this change is fine.

@MartinNowak
Copy link
Member Author

But delete ary wasn't resetting memory before #864.

@schveiguy
Copy link
Member

Sure, and really, delete frees the memory, so any access to a dangling reference is invalid whether you re-initialize or not.

@MartinNowak MartinNowak added the GC garbage collector label Mar 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

GC garbage collector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants