[Issue 24147] Struct destructors should not allow GC

2023-09-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24147 elpenguin...@gmail.com changed: What|Removed |Added CC||elpenguin...@gmail.com --- Comment

[Issue 24147] New: Struct destructors should not allow GC

2023-09-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24147 Issue ID: 24147 Summary: Struct destructors should not allow GC Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

[Issue 14261] Struct destructors shouldn't be called when in a closure

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14261 Iain Buclaw changed: What|Removed |Added Priority|P1 |P2 --

[Issue 22412] std.parallelism WorkerLocalStorage calls struct destructors on uninitialized memory

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22412 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 22507] Struct destructors must enjoy special status with regard to @safe/@trusted/@system

2021-11-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22507 Dennis changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 22507] New: Struct destructors must enjoy special status with regard to @safe/@trusted/@system

2021-11-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22507 Issue ID: 22507 Summary: Struct destructors must enjoy special status with regard to @safe/@trusted/@system Product: D Version: D2 Hardware: All OS: All

[Issue 22412] New: std.parallelism WorkerLocalStorage calls struct destructors on uninitialized memory

2021-10-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22412 Issue ID: 22412 Summary: std.parallelism WorkerLocalStorage calls struct destructors on uninitialized memory Product: D Version: D2 Hardware: x86_64 OS: Linux

[Issue 20897] -betterC generates `try`/`catch` in the AST when using struct destructors

2020-06-28 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20897 --- Comment #3 from kinke --- A similar example (from https://github.com/ldc-developers/ldc/issues/3479), this time for scope(exit): void create(uint a, uint b, string c) {} extern(C) int main() { int a = 5; scope(exit) a = 6; create(0,

[Issue 20897] -betterC generates `try`/`catch` in the AST when using struct destructors

2020-06-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20897 kinke changed: What|Removed |Added CC||ki...@gmx.net --- Comment #2 from kinke ---

[Issue 20897] -betterC generates `try`/`catch` in the AST when using struct destructors

2020-06-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20897 --- Comment #1 from Roxanne --- I meant LDC 1.21.0 with LLVM 10.0.0, not LDC 10.0.0, sorry for the inconvenience --

[Issue 20897] New: -betterC generates `try`/`catch` in the AST when using struct destructors

2020-06-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20897 Issue ID: 20897 Summary: -betterC generates `try`/`catch` in the AST when using struct destructors Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: Struct destructors not available in -betterC?

2018-07-11 Thread Gary Willoughby via Digitalmars-d
On Tuesday, 10 July 2018 at 20:33:46 UTC, Seb wrote: But they easily can be: https://github.com/dlang/dlang.org/pull/2415 Thanks.

Re: Struct destructors not available in -betterC?

2018-07-10 Thread Seb via Digitalmars-d
On Tuesday, 10 July 2018 at 19:28:34 UTC, SrMordred wrote: On Tuesday, 10 July 2018 at 19:14:26 UTC, Gary Willoughby wrote: Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem

Re: Struct destructors not available in -betterC?

2018-07-10 Thread SrMordred via Digitalmars-d
On Tuesday, 10 July 2018 at 19:14:26 UTC, Gary Willoughby wrote: Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem to be true as I'm using them with no problem. Yep, the docs

Struct destructors not available in -betterC?

2018-07-10 Thread Gary Willoughby via Digitalmars-d
Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem to be true as I'm using them with no problem.

Re: T.init, struct destructors and invariants - should they be called?

2018-07-10 Thread FeepingCreature via Digitalmars-d
On Tuesday, 10 July 2018 at 00:01:28 UTC, Steven Schveighoffer wrote: On 7/7/18 11:06 PM, FeepingCreature wrote: On Friday, 6 July 2018 at 23:37:30 UTC, Simen Kjærås wrote: As for alignment, GC, and possibly other things, the code was not intended as a complete implementation of Nullable, only

Re: T.init, struct destructors and invariants - should they be called?

2018-07-09 Thread Steven Schveighoffer via Digitalmars-d
On 7/7/18 11:06 PM, FeepingCreature wrote: On Friday, 6 July 2018 at 23:37:30 UTC, Simen Kjærås wrote: As for alignment, GC, and possibly other things, the code was not intended as a complete implementation of Nullable, only to show that an actual member of type T is not necessary. These

Re: T.init, struct destructors and invariants - should they be called?

2018-07-07 Thread FeepingCreature via Digitalmars-d
On Friday, 6 July 2018 at 23:37:30 UTC, Simen Kjærås wrote: As for alignment, GC, and possibly other things, the code was not intended as a complete implementation of Nullable, only to show that an actual member of type T is not necessary. These issues are fixable, if perhaps nontrivial in

Re: T.init, struct destructors and invariants - should they be called?

2018-07-06 Thread Simen Kjærås via Digitalmars-d
On Friday, 6 July 2018 at 12:31:50 UTC, FeepingCreature wrote: On Friday, 6 July 2018 at 12:10:58 UTC, Simen Kjærås wrote: The rest looks sensible to me, but I have to say this is bollocks. This Nullable never has to construct an S.init: struct Nullable(T) { ubyte[T.sizeof] _payload;

Re: T.init, struct destructors and invariants - should they be called?

2018-07-06 Thread FeepingCreature via Digitalmars-d
On Friday, 6 July 2018 at 12:10:58 UTC, Simen Kjærås wrote: The rest looks sensible to me, but I have to say this is bollocks. This Nullable never has to construct an S.init: struct Nullable(T) { ubyte[T.sizeof] _payload; bool _hasValue; Come on, at least make it a union with a

Re: T.init, struct destructors and invariants - should they be called?

2018-07-06 Thread Simen Kjærås via Digitalmars-d
On Friday, 6 July 2018 at 10:44:09 UTC, FeepingCreature wrote: Why is this a problem? ("Just don't use S.init!") Well, for one it makes Nullable!S impossible. Nullable, if it is to be @nogc, *necessarily* has to construct an S.init struct member. The rest looks sensible to me, but I have to

Re: T.init, struct destructors and invariants - should they be called?

2018-07-06 Thread FeepingCreature via Digitalmars-d
On Friday, 6 July 2018 at 10:44:09 UTC, FeepingCreature wrote: Consider the humble struct S { Object obj; invariant { assert(this.obj !is null); } @disable this(); this(Object obj) in(obj !is null) { this.obj = obj; } } Oops - there should of

T.init, struct destructors and invariants - should they be called?

2018-07-06 Thread FeepingCreature via Digitalmars-d
I believe there's a good case that struct invariants should not be called on struct destruction. Significantly, I believe that Phobos, in particular `moveEmplace`, is already written as if this is the case, even though it is not specified anywhere. It is very common for structs' .init to

[Issue 17603] "undefined reference to `__dmd_personality_v0'" with -betterC and struct destructors

2018-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17603 Mike Franklin changed: What|Removed |Added Status|NEW |RESOLVED

Re: betterC and struct destructors

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 10:18:41 UTC, Oleg B wrote: Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found

Re: betterC and struct destructors

2017-09-11 Thread Vadim Lopatin via Digitalmars-d-learn
in betterC code. Otherwise it will be one step to be likeC, not betterC. +1 I don't see the reason. If struct destructors were working correctly in betterC mode, it would be possible to use RAII. Missing RAII is a main reason of WTF messages when people see list of betterC limitations.

betterC and struct destructors

2017-09-11 Thread Oleg B via Digitalmars-d-learn
Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found https://dlang.org/spec/betterc.html#consequences 12 paragraph: Struct deconstructors. Why

[Issue 14423] struct destructors not finalized for AA values

2017-07-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14423 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to dmd-cxx at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/cfcf7480b2faea0af9ab6ddba8e3b0d9f05c4415 Merge pull request #1212 from

[Issue 17603] New: "undefined reference to `__dmd_personality_v0'" with -betterC and struct destructors

2017-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17603 Issue ID: 17603 Summary: "undefined reference to `__dmd_personality_v0'" with -betterC and struct destructors Product: D Version: D2 Hardware: All

Re: Struct destructors not always called?

2015-12-27 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:47:52 UTC, Adam D. Ruppe wrote: On Sunday, 27 December 2015 at 18:40:55 UTC, Jeremy DeHaan wrote: I was playing around with some code today and I noticed that in some cases struct destructors are not called. struct destructors are called when the struct

Re: Struct destructors not always called?

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:40:55 UTC, Jeremy DeHaan wrote: I was playing around with some code today and I noticed that in some cases struct destructors are not called. struct destructors are called when the struct ceases to exist in the program. A global variable never ceases

Re: Struct destructors not always called?

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 December 2015 at 19:04:11 UTC, Jeremy DeHaan wrote: So are these left dangling or do they actually get cleaned up at the program exit? They are left dangling right now. You can clear it yourself by defining a `static ~this() { .destroy(your struct); }` somewhere in the module.

Struct destructors not always called?

2015-12-27 Thread Jeremy DeHaan via Digitalmars-d-learn
I was playing around with some code today and I noticed that in some cases struct destructors are not called. for example: impost std.stdio; SomeStruct global; void main() { SomeStruct inMain; writeln(global.thing); writeln(inMain.thing); writeln(getSomeInt()); } int getSomeInt

[Issue 14423] struct destructors not finalized for AA values

2015-06-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14423 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to stable at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/cfcf7480b2faea0af9ab6ddba8e3b0d9f05c4415 Merge pull request

[Issue 14423] struct destructors not finalized for AA values

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14423 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|unspecified |D2 --

[Issue 3606] Problems with struct destructors and const structs

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3606 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|2.036 |D2 --

[Issue 14423] struct destructors not finalized for AA values

2015-04-17 Thread via Digitalmars-d-bugs
#1212 from rainers/aa_entry_typeinfo fix Issue 14423 - struct destructors not finalized for AA values --

[Issue 14423] struct destructors not finalized for AA values

2015-04-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14423 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added Keywords||pull

[Issue 14423] New: struct destructors not finalized for AA values

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14423 Issue ID: 14423 Summary: struct destructors not finalized for AA values Product: D Version: unspecified Hardware: All OS: All Status: NEW Severity: major

[Issue 14261] New: Struct destructors shouldn't be called when in a closure

2015-03-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14261 Issue ID: 14261 Summary: Struct destructors shouldn't be called when in a closure Product: D Version: D2 Hardware: All OS: All Status: NEW

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2015-02-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #31 from github-bugzi...@puremagic.com --- Commit pushed to 2.067 at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/dbbea7c5bd4d8936dc8cb523b65f771842f2a487 Merge pull request

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2015-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #30 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/dbbea7c5bd4d8936dc8cb523b65f771842f2a487 Merge pull request

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2015-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #28 from Orvid King blah38...@gmail.com --- Where should I add it? It can't be in rt.lifetime, because that's not exposed to the user. --

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #29 from Andrei Alexandrescu and...@erdani.com --- core.memory? --

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #27 from Andrei Alexandrescu and...@erdani.com --- Could you please add a function to druntime callStructDtorsDuringGC(bool)? That would give a chance people who have issues with the called destructors to revert back to the old behavior

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #25 from Orvid King blah38...@gmail.com --- Fine by me. --

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #23 from Orvid King blah38...@gmail.com --- And another update. The fix to the other issue that this encountered has already been merged, and the main DRuntime PR has been running green on the autotester for a while now. It's just

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-08-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #24 from Andrei Alexandrescu and...@erdani.com --- Ready to take the big step with 2.067? --

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #22 from Orvid King blah38...@gmail.com --- Ok, so, to give an update on this issue, I've now implemented the invoking of destructors on heap allocated structs, as well as arrays of structs. It required a fix to a bug in DMD with the

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 Dmitry Olshansky dmitry.o...@gmail.com changed: What|Removed |Added CC||dmitry.o...@gmail.com

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de ---

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #15 from Orvid King blah38...@gmail.com --- Would making all the writeln's in http://dpaste.dzfl.pl/fbb4a15cda14 print out be an acceptable solution to this issue? (that is, making heap-allocated structs call their destructors) --

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 David Nadlinger c...@klickverbot.at changed: What|Removed |Added CC||c...@klickverbot.at ---

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 Orvid King blah38...@gmail.com changed: What|Removed |Added CC||blah38...@gmail.com ---

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #18 from Jonathan M Davis jmdavisp...@gmx.com --- (In reply to Orvid King from comment #17) https://github.com/D-Programming-Language/druntime/pull/864 It's not feasibly possible to call destructors on heap-allocated arrays of

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #19 from Orvid King blah38...@gmail.com --- We still wouldn't be able to call the destructors in structs for arrays even with precise heap scanning, because we can't know that each value in the array is actually valid. Take for instance

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-03 Thread via Digitalmars-d-bugs
...@adroll.com --- Comment #12 from Benoit Rostykus benoit.rosty...@adroll.com --- AdRoll (the company I work for) just put a $1000 bounty on this bug: https://www.bountysource.com/issues/2900969-struct-destructors-are-not-called-by-the-gc-but-called-on-explicit-delete We are really excited about D

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-03 Thread via Digitalmars-d-bugs
--- Comment #13 from Jonathan M Davis jmdavisp...@gmx.com --- I'd strongly argue that we make it so that struct destructors get called when the memory for a struct is freed on the GC heap (though that pretty requires what precise heap scanning requires as Sean points out). However, it should

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-07-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2834 --- Comment #14 from Jonathan M Davis jmdavisp...@gmx.com --- (In reply to Benoit Rostykus from comment #12) AdRoll (the company I work for) just put a $1000 bounty on this bug: That's quite the bounty. --

Is it supposed to be safe to throw inside struct destructors?

2014-04-07 Thread Marco Leise
I would like to hear a definite answer on this. A failure in ~this() leaves the program in an undefined state. You cannot back out of returning from a function that needs to perform cleanup on stack structs. Constructors do not have this problem. With scope(failure) you can guard all resources and

Re: Is it supposed to be safe to throw inside struct destructors?

2014-04-07 Thread Dmitry Olshansky
07-Apr-2014 12:33, Marco Leise пишет: I would like to hear a definite answer on this. A failure in ~this() leaves the program in an undefined state. You cannot back out of returning from a function that needs to perform cleanup on stack structs. Constructors do not have this problem. With

Re: Is it supposed to be safe to throw inside struct destructors?

2014-04-07 Thread monarch_dodra
On Monday, 7 April 2014 at 19:19:18 UTC, Dmitry Olshansky wrote: 07-Apr-2014 12:33, Marco Leise пишет: I would like to hear a definite answer on this. A failure in ~this() leaves the program in an undefined state. You cannot back out of returning from a function that needs to perform cleanup on

Re: Is it supposed to be safe to throw inside struct destructors?

2014-04-07 Thread Marco Leise
Am Mon, 07 Apr 2014 21:36:34 + schrieb monarch_dodra monarchdo...@gmail.com: On Monday, 7 April 2014 at 19:19:18 UTC, Dmitry Olshansky wrote: 07-Apr-2014 12:33, Marco Leise пишет: I would like to hear a definite answer on this. A failure in ~this() leaves the program in an undefined

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-02-28 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=2834 Dicebot pub...@dicebot.lv changed: What|Removed |Added CC||pub...@dicebot.lv

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2014-02-28 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=2834 rswhi...@googlemail.com changed: What|Removed |Added CC||rswhi...@googlemail.com ---

[Issue 3606] Problems with struct destructors and const structs

2011-06-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3606 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added CC||k.hara...@gmail.com

[Issue 3606] Problems with struct destructors and const structs

2011-06-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3606 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: struct destructors

2011-05-16 Thread Steven Schveighoffer
On Mon, 09 May 2011 17:04:49 -0400, Sean Kelly s...@invisibleduck.org wrote: On May 9, 2011, at 12:51 PM, Alexander wrote: On 09.05.2011 19:38, Sean Kelly wrote: Not currently. I thought I wrote some explanation of why... OK, thanks - I've read the ticket. Though, the problem can be

struct destructors

2011-05-09 Thread Alexander
Are those supposed to be called when struct was allocated on the heap and is collected by GC? According to my observations (DMD 2.052 Linux), they are called only when: - struct is allocated on the stack and goes out of scope; - explicit delete is called on heap-allocated struct. /Alexander

Re: struct destructors

2011-05-09 Thread Sean Kelly
On May 9, 2011, at 9:21 AM, Alexander wrote: Are those supposed to be called when struct was allocated on the heap and is collected by GC? Not currently. I thought I wrote some explanation of why... somewhere, but I can't find it right now (2834 is the ticket number for this issue, but my

Re: struct destructors

2011-05-09 Thread Alexander
only for cases when collected object is not a class. For now, it seems, better to avoid struct destructors at all, or resort to classes. /Alexander

Re: struct destructors

2011-05-09 Thread Sean Kelly
On May 9, 2011, at 12:51 PM, Alexander wrote: On 09.05.2011 19:38, Sean Kelly wrote: Not currently. I thought I wrote some explanation of why... OK, thanks - I've read the ticket. Though, the problem can be solved relatively simple, IMHO - adding one more pointer to BlkInfo, where

Re: [Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-11-22 Thread Max Samukha
CC| |samu...@voliacable.com --- Comment #8 from Max Samukhasamu...@voliacable.com 2010-11-18 03:39:17 PST --- So what is the verdict? Should we simply specify that struct destructors are not automatically called except in RAII and remove the struct-in-class special

Re: [Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-11-21 Thread Sean Kelly
| |samu...@voliacable.com --- Comment #8 from Max Samukha samu...@voliacable.com 2010-11-18 03:39:17 PST --- So what is the verdict? Should we simply specify that struct destructors are not automatically called except in RAII and remove the struct-in-class special case

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-11-18 Thread d-bugmail
...@voliacable.com --- Comment #8 from Max Samukha samu...@voliacable.com 2010-11-18 03:39:17 PST --- So what is the verdict? Should we simply specify that struct destructors are not automatically called except in RAII and remove the struct-in-class special case? BTW, there are other problems (serious IMO

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 --- Comment #9 from Max Samukha samu...@voliacable.com 2010-11-18 03:59:12 PST --- (In reply to comment #8) We have a nasty problem when destructors are called on the appended elements because postblits was not run for them during append. I

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-07-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc ---

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-07-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 --- Comment #7 from bearophile_h...@eml.cc 2010-07-11 17:24:58 PDT --- One case where struct destructors are not called, in this situation it seems simpler for the GC to know what destructors to call: import core.memory: GC; import

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 Rob Jacques sandf...@jhu.edu changed: What|Removed |Added CC||and...@metalanguage.com

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 Sean Kelly s...@invisibleduck.org changed: What|Removed |Added CC|

[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

2010-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2834 --- Comment #5 from Sean Kelly s...@invisibleduck.org 2010-07-10 08:41:54 PDT --- Fixing this will probably be fairly involved. The GC will have to store a TypeInfo reference for each block that needs to be finalized. The best approach may

Re: Finding and invoking struct destructors in D2

2010-05-27 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pillsy wrote: Hi, all, I was wondering if there's any way to determine at compile time whether a struct has a (non-trivial) destructor associated with it, and whether there's any way to call that destructor without using the delete operator. It

Re: Finding and invoking struct destructors in D2

2010-05-27 Thread Pillsy
== Quote from div0 (d...@users.sourceforge.net)'s article: [...] Most important is this one, which scuppers any change of doing a shared ptr like struct: http://d.puremagic.com/issues/show_bug.cgi?id=3516 Yeah, that basically kills the idea until the bug is fixed. :( Once it is, I think a

Re: Finding and invoking struct destructors in D2

2010-05-27 Thread Don
div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pillsy wrote: Hi, all, I was wondering if there's any way to determine at compile time whether a struct has a (non-trivial) destructor associated with it, and whether there's any way to call that destructor without using the delete

[Issue 3606] New: Problems with struct destructors and const structs

2009-12-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3606 Summary: Problems with struct destructors and const structs Product: D Version: 2.036 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2

[Issue 3606] Problems with struct destructors and const structs

2009-12-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3606 --- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com 2009-12-11 07:08:40 PST --- Well... compiler's complaints are understandable, you are trying to do meaningless thing. -- Configure issuemail:

[Issue 3606] Problems with struct destructors and const structs

2009-12-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3606 --- Comment #1 from Sobirari Muhomori dfj1es...@sneakemail.com 2009-12-11 07:05:10 PST --- Errors in 2.031: Error: destructor tmp.Foo.~this () does not match parameter types () Error: f.~this can only be called on a mutable object, not