https://issues.dlang.org/show_bug.cgi?id=24147
elpenguin...@gmail.com changed:
What|Removed |Added
CC||elpenguin...@gmail.com
--- Comment
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
https://issues.dlang.org/show_bug.cgi?id=14261
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=22412
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=22507
Dennis changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
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
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
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,
https://issues.dlang.org/show_bug.cgi?id=20897
kinke changed:
What|Removed |Added
CC||ki...@gmx.net
--- Comment #2 from kinke ---
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
--
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
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.
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
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
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.
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
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
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
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;
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
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
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
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
https://issues.dlang.org/show_bug.cgi?id=17603
Mike Franklin changed:
What|Removed |Added
Status|NEW |RESOLVED
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
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.
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
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
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
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
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
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.
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
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
https://issues.dlang.org/show_bug.cgi?id=14423
Andrei Alexandrescu and...@erdani.com changed:
What|Removed |Added
Version|unspecified |D2
--
https://issues.dlang.org/show_bug.cgi?id=3606
Andrei Alexandrescu and...@erdani.com changed:
What|Removed |Added
Version|2.036 |D2
--
#1212 from rainers/aa_entry_typeinfo
fix Issue 14423 - struct destructors not finalized for AA values
--
https://issues.dlang.org/show_bug.cgi?id=14423
Rainer Schuetze r.sagita...@gmx.de changed:
What|Removed |Added
Keywords||pull
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
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
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
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
https://issues.dlang.org/show_bug.cgi?id=2834
github-bugzi...@puremagic.com changed:
What|Removed |Added
Status|NEW |RESOLVED
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.
--
https://issues.dlang.org/show_bug.cgi?id=2834
--- Comment #29 from Andrei Alexandrescu and...@erdani.com ---
core.memory?
--
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
https://issues.dlang.org/show_bug.cgi?id=2834
--- Comment #25 from Orvid King blah38...@gmail.com ---
Fine by me.
--
https://issues.dlang.org/show_bug.cgi?id=2834
hst...@quickfur.ath.cx changed:
What|Removed |Added
CC||hst...@quickfur.ath.cx
--- Comment
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
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?
--
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
https://issues.dlang.org/show_bug.cgi?id=2834
Dmitry Olshansky dmitry.o...@gmail.com changed:
What|Removed |Added
CC||dmitry.o...@gmail.com
https://issues.dlang.org/show_bug.cgi?id=2834
Rainer Schuetze r.sagita...@gmx.de changed:
What|Removed |Added
CC||r.sagita...@gmx.de
---
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)
--
https://issues.dlang.org/show_bug.cgi?id=2834
David Nadlinger c...@klickverbot.at changed:
What|Removed |Added
CC||c...@klickverbot.at
---
https://issues.dlang.org/show_bug.cgi?id=2834
Orvid King blah38...@gmail.com changed:
What|Removed |Added
CC||blah38...@gmail.com
---
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
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
...@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
--- 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
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.
--
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
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
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
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
https://d.puremagic.com/issues/show_bug.cgi?id=2834
Dicebot pub...@dicebot.lv changed:
What|Removed |Added
CC||pub...@dicebot.lv
https://d.puremagic.com/issues/show_bug.cgi?id=2834
rswhi...@googlemail.com changed:
What|Removed |Added
CC||rswhi...@googlemail.com
---
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
http://d.puremagic.com/issues/show_bug.cgi?id=3606
yebblies yebbl...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
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
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
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
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
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
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
|
|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
...@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
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
http://d.puremagic.com/issues/show_bug.cgi?id=2834
bearophile_h...@eml.cc changed:
What|Removed |Added
CC||bearophile_h...@eml.cc
---
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
http://d.puremagic.com/issues/show_bug.cgi?id=2834
Rob Jacques sandf...@jhu.edu changed:
What|Removed |Added
CC||and...@metalanguage.com
http://d.puremagic.com/issues/show_bug.cgi?id=2834
Sean Kelly s...@invisibleduck.org changed:
What|Removed |Added
CC|
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
-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
== 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
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
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
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:
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
89 matches
Mail list logo