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

TypeInfo.swap must not allow reachable memory to be freed if interrupted by a garbage collection pass #3264

Merged
merged 1 commit into from Nov 5, 2020

Conversation

n8sh
Copy link
Member

@n8sh n8sh commented Nov 5, 2020

If the type might contain pointers perform the swap in pointer-sized chunks in case a garbage collection pass occurs partway through the function. Directly affected TypeInfo subclasses that were not overriding swap:

  • TypeInfo_AssociativeArray
  • TypeInfo_Class
  • TypeInfo_Delegate
  • TypeInfo_Interface
  • TypeInfo_Struct

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @n8sh!

Bugzilla references

Auto-close Bugzilla Severity Description
21365 normal TypeInfo.swap must not allow reachable memory to be freed if interrupted by a garbage collection pass

Testing this PR locally

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

dub run digger -- build "stable + druntime#3264"

@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label Nov 5, 2020
… freed if interrupted by a garbage collection pass

If the type might contain pointers perform the swap in pointer-sized
chunks in case a garbage collection pass interrupts the function.
Directly affected TypeInfo subclasses that were not overriding swap:

- TypeInfo_AssociativeArray
- TypeInfo_Class
- TypeInfo_Delegate
- TypeInfo_Interface
- TypeInfo_Struct
@dlang-bot dlang-bot merged commit e1b5344 into dlang:stable Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Fix Include reference to corresponding bugzilla issue
Projects
None yet
3 participants