The GC will now call destructors on heap allocated structs. It is imp…
…ossible to feasibly implement the invokation of arrays of finalizable structs, due to the inability to know which elements in the array, which may, or may not have been, initialized to begin with. There is also no way to know what the actual length of the array is, you can know how much memory was allocated for it, but not whether there was ever a reference to that point in the array. The destructors for structs in classes are still called as they were previously, which is immediately after the body of the outer class's finalizer.
Added _d_delstruct for use by the delete operator when deleting a poi…
…nter to a struct. Also removed the need for a separate array of struct infos by storing the pointer to it at the end of the page for structs allocated by the GC that have finalizers.
Removed the STRUCT_FINALIZE block attribute. Also fixed an issue in m…
…y initial implementation of the type info being moved to the end of the page.
As discussed on the PR, removed StructInfo, and replaced all uses of …
…it with TypeInfo_Struct. I also made the runtime entirely responsible for managing the type info of a finalizable struct. Previously the GC first had to retrieve this info before calling the runtime to do the finalization, even though it's the runtime that determined where to put the type info.
TypeInfo_Struct.destroy needed to check if the pointer is owned by th…
…e GC, and if so, have the GC run it's finalizers rather than calling the finalizer directly.
Fixed an edge case where an array that didn't have a large enough all…
…ocation was incorrectly being treated as if it did.
Minor changes for effeciency to array finalization, as well as added …
…callStructDtorsDuringGC to core.memory.
Fixed a couple of places where ti.next was still being used.
Also fixed a minor issue with an import.
Use GC.qalloc rather than GC.malloc + GC.sizeOf.
Also fixed the BlkInfo calculations to account for the sentinal bytes.
- remove StructFinalizers, preallocate FinalizeError
- remove TypeInfo from gc.setAttr/setBita - assumeSafeAppend now calls struct destructors, checks whether the array is really shrinked - remove rt_ prefix from internal functions - add tests
fix calling destructors on qualified structs
optimize by not calling TypeInfo.next again and again remove type info argument from GC.setAttr/setBits
The GC will now call destructors on heap allocated structs. It is imp…
…ossible to feasibly implement the invokation of arrays of finalizable structs, due to the inability to know which elements in the array, which may, or may not have been, initialized to begin with. There is also no way to know what the actual length of the array is, you can know how much memory was allocated for it, but not whether there was ever a reference to that point in the array. The destructors for structs in classes are still called as they were previously, which is immediately after the body of the outer class's finalizer.
Added _d_delstruct for use by the delete operator when deleting a poi…
…nter to a struct. Also removed the need for a separate array of struct infos by storing the pointer to it at the end of the page for structs allocated by the GC that have finalizers.
Removed the STRUCT_FINALIZE block attribute. Also fixed an issue in m…
…y initial implementation of the type info being moved to the end of the page.
As discussed on the PR, removed StructInfo, and replaced all uses of …
…it with TypeInfo_Struct. I also made the runtime entirely responsible for managing the type info of a finalizable struct. Previously the GC first had to retrieve this info before calling the runtime to do the finalization, even though it's the runtime that determined where to put the type info.
TypeInfo_Struct.destroy needed to check if the pointer is owned by th…
…e GC, and if so, have the GC run it's finalizers rather than calling the finalizer directly.
Fixed an edge case where an array that didn't have a large enough all…
…ocation was incorrectly being treated as if it did.
Minor changes for effeciency to array finalization, as well as added …
…callStructDtorsDuringGC to core.memory.
Fixed a couple of places where ti.next was still being used.
Also fixed a minor issue with an import.
Use GC.qalloc rather than GC.malloc + GC.sizeOf.
Also fixed the BlkInfo calculations to account for the sentinal bytes.
- remove StructFinalizers, preallocate FinalizeError
- remove TypeInfo from gc.setAttr/setBita - assumeSafeAppend now calls struct destructors, checks whether the array is really shrinked - remove rt_ prefix from internal functions - add tests
fix calling destructors on qualified structs
optimize by not calling TypeInfo.next again and again remove type info argument from GC.setAttr/setBits
Removed the callStructDtorsDuringGC field in core/memory.d.
Trimmed the trailing whitespace on a couple of lines in rt/lifetime.d.
Merge pull request #864 from Orvid/structDestructors
Fix Issue 2834 - The GC will now call destructors on heap allocated structs