June 21, 2011 [Issue 6188] New: Add ability to call element dtors to array blocks | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6188 Summary: Add ability to call element dtors to array blocks Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: druntime AssignedTo: nobody@puremagic.com ReportedBy: schveiguy@yahoo.com --- Comment #0 from Steven Schveighoffer <schveiguy@yahoo.com> 2011-06-21 05:04:39 PDT --- Currently, when an array of structs is created on the heap, the destructor for those structs is not called when the GC collects the memory block. However, this can be fixed by having the runtime store the typeinfo used to create the block inside the block, along with a flag indicating a finalizer. Proposed design: lifetime.d: Store the typeinfo reference in the last bytes of small blocks, beside the length in large blocks. If the typeinfo has no dtor, don't store it. If the typeinfo is stored, mark the block as containing a finalizer. gcx.d: when finalizing a block that has both appendable and finalizer set, call a lifetime.d function which finalizes the array (new function) std.array: Appender should use the finalizer mechanism above to store the typeinfo if necessary. Not sure at this point how it will interact with array runtime. However, there are pending improvements for Appender that may make this easier (see bug 5813). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 21, 2011 [Issue 6188] Add ability to call element dtors to array blocks | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=6188 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|nobody@puremagic.com |schveiguy@yahoo.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation