July 27, 2018 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 --- Comment #10 from Manu <turkeyman@gmail.com> --- Right, and that goes back to my original point; the GC doesn't know the memory is a C++ class, and doesn't know how to destruct. So either, use the GC under the assumption the destructor will never be called... or maybe there's some opportunity to make gcnew wrap C++ class allocations in a thin D class that forwards the destructor? -- |
July 27, 2018 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 --- Comment #11 from kinke@gmx.net --- (In reply to Manu from comment #10) > or maybe there's some opportunity to make gcnew wrap C++ class allocations in a thin D class that forwards the destructor? I guess something like having specially-marked GC blocks for C++ objects and gcnew prepending the C++ dtor (or D ClassInfo) address right before the actual class instance would work => 1 pointer overhead per GC-allocated C++ object to make it destructible during garbage collection. -- |
July 27, 2018 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 --- Comment #12 from kinke@gmx.net --- Something very similar is apparently already done for GC-allocated structs - if they have a destructor, the TypeInfo pointer is stored right after the actual instance, and a specially marked GC block is requested; see rt.lifetime._d_newitemU(). -- |
July 27, 2018 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 --- Comment #13 from Manu <turkeyman@gmail.com> --- (In reply to kinke from comment #12) > Something very similar is apparently already done for GC-allocated structs - if they have a destructor, the TypeInfo pointer is stored right after the actual instance, and a specially marked GC block is requested; see rt.lifetime._d_newitemU(). Right. I think gcnew should implement a trick like that for C++ objects. I don't have time to look at it now though. Super-busy, which is why I was rushing to get all my C++ stuff in a month back. -- |
December 17, 2022 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
December 13 [Issue 19119] App crashes with strange behavior of ctors/dtors from CPP | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19119 --- Comment #14 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19468 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation