The GC will now call destructors on heap allocated structs. It is impossible 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 pointer 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 my initial implementation of the type info being moved to the end of the page.
Destructors of structs in arrays are now called as well.
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 the 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 allocation 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.
I missed a piece when merging with master.
refactorings for less GC information callbacks
fix shared library finalize issue
move struct TypeInfo to the end of the memory block, after SMALLPAD/MEDPAD
refactor: only pass BlkAttr.STRUCTFINAL bit to GC
- 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
check postblit for array of const struct