{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/864","labels_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/864/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/864/comments","events_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/864/events","html_url":"https://github.com/D-Programming-Language/druntime/pull/864","id":37187164,"number":864,"title":"Fix Issue 2834 - The GC will now call destructors on heap allocated structs","user":{"login":"Orvid","id":709247,"avatar_url":"https://avatars.githubusercontent.com/u/709247?v=3","gravatar_id":"","url":"https://api.github.com/users/Orvid","html_url":"https://github.com/Orvid","followers_url":"https://api.github.com/users/Orvid/followers","following_url":"https://api.github.com/users/Orvid/following{/other_user}","gists_url":"https://api.github.com/users/Orvid/gists{/gist_id}","starred_url":"https://api.github.com/users/Orvid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orvid/subscriptions","organizations_url":"https://api.github.com/users/Orvid/orgs","repos_url":"https://api.github.com/users/Orvid/repos","events_url":"https://api.github.com/users/Orvid/events{/privacy}","received_events_url":"https://api.github.com/users/Orvid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/D-Programming-Language/druntime/labels/GC","name":"GC","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":83,"created_at":"2014-07-04T21:49:48Z","updated_at":"2015-03-25T07:45:00Z","closed_at":"2015-01-15T10:49:09Z","pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/864","html_url":"https://github.com/D-Programming-Language/druntime/pull/864","diff_url":"https://github.com/D-Programming-Language/druntime/pull/864.diff","patch_url":"https://github.com/D-Programming-Language/druntime/pull/864.patch"},"body":"~~This PR is not quite ready to merge, as I need to add a set  of tests for it, and also need to get it to work on arrays of structures as well. I am creating it now to make sure that I've not gone and broken druntime terribly with my approach to fixing the issue, as well as to take feedback on my method of solving the issue.~~ And the link to the issue this solves is [here](https://issues.dlang.org/show_bug.cgi?id=2834).\r\n\r\nIn the case where a struct is a member of a class, the struct's destructor will be called after the body of the class's destructor.\r\n\r\nThis PR is now ready to be reviewed and hopefully merged. It is not feasible to implement calling destructors of structs in heap allocated arrays for various reasons, including the inability to know which elements of the array are actually initialized, as well as which elements are valid.\r\n\r\nThis requires D-Programming-Language/dmd#3727\r\n\r\nhttps://issues.dlang.org/show_bug.cgi?id=2834"},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/comments/85902848","html_url":"https://github.com/D-Programming-Language/druntime/pull/864#issuecomment-85902848","issue_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/864","id":85902848,"user":{"login":"Orvid","id":709247,"avatar_url":"https://avatars.githubusercontent.com/u/709247?v=3","gravatar_id":"","url":"https://api.github.com/users/Orvid","html_url":"https://github.com/Orvid","followers_url":"https://api.github.com/users/Orvid/followers","following_url":"https://api.github.com/users/Orvid/following{/other_user}","gists_url":"https://api.github.com/users/Orvid/gists{/gist_id}","starred_url":"https://api.github.com/users/Orvid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orvid/subscriptions","organizations_url":"https://api.github.com/users/Orvid/orgs","repos_url":"https://api.github.com/users/Orvid/repos","events_url":"https://api.github.com/users/Orvid/events{/privacy}","received_events_url":"https://api.github.com/users/Orvid/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T07:45:00Z","updated_at":"2015-03-25T07:45:00Z","body":"The `TypeInfo_Struct` pointer is at the beginning of large allocations for the same reason the length of a large allocation is at the beginning. It's also because there was already unused space in the padding that the pointer could be slipped into without difficulty."}}