[Issue 11331] Inefficient initialization of struct with members = void

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P2  |P4

--


[Issue 11331] Inefficient initialization of struct with members = void

2018-05-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

johanenge...@weka.io changed:

   What|Removed |Added

 CC||johanenge...@weka.io

--- Comment #9 from johanenge...@weka.io ---
Assignment with T.init is used to remove dangling pointers after destruction:
https://github.com/dlang/druntime/blob/54ab96e9977e0c6baa7ed9740810058fd4aec6ef/src/object.d#L3082-L3098
So if spec is changed/clarified on this issue, we probably need to change/fix
that code too. (if there isn't already, we need help from traits to figure out
which members are =void, such that we can zero them explicitly)

--


[Issue 11331] Inefficient initialization of struct with members = void

2018-04-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

Shachar Shemesh  changed:

   What|Removed |Added

 CC||shac...@weka.io

--


[Issue 11331] Inefficient initialization of struct with members = void

2017-08-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4  changed:

   What|Removed |Added

   Keywords||spec

--


[Issue 11331] Inefficient initialization of struct with members = void

2017-08-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=10643

--


[Issue 11331] Inefficient initialization of struct with members = void

2017-08-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

--- Comment #7 from anonymous4  ---
*** Issue 15951 has been marked as a duplicate of this issue. ***

--


[Issue 11331] Inefficient initialization of struct with members = void

2017-08-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #8 from anonymous4  ---
*** Issue 11817 has been marked as a duplicate of this issue. ***

--


[Issue 11331] Inefficient initialization of struct with members = void

2016-10-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

Martin Nowak  changed:

   What|Removed |Added

 CC||c...@dawg.eu

--- Comment #6 from Martin Nowak  ---
It's almost somewhat of a language fix, b/c they are silently ignored,
everybody expects them to work (seen that discussion/mistake several times
already, recent occurence
https://forum.dlang.org/post/ntfrgh$1l2n$1...@digitalmars.com).

Until we use that information for more efficient initialization we should
probably warn about that = void on a struct field has no effect.

--


[Issue 11331] Inefficient initialization of struct with members = void

2016-09-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

gyroh...@gmail.com changed:

   What|Removed |Added

 CC||gyroh...@gmail.com

--- Comment #5 from gyroh...@gmail.com ---
Is anything being worked on to change this?

--


[Issue 11331] Inefficient initialization of struct with members = void

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331

Jack Stouffer  changed:

   What|Removed |Added

   Keywords||performance
 CC||j...@jackstouffer.com

--


[Issue 11331] Inefficient initialization of struct with members = void

2013-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=11331


Dicebot pub...@dicebot.lv changed:

   What|Removed |Added

 CC||pub...@dicebot.lv


--- Comment #1 from Dicebot pub...@dicebot.lv 2013-10-23 09:26:14 PDT ---
Erm, isn't it by spec? `void` initializer is targeted for variables, not member
fields. Here it just says that relevant `T.init` part can be garbage.

Fixing this issue would imply that there are no more guaranteed deterministic
T.init values for all types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 11331] Inefficient initialization of struct with members = void

2013-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=11331



--- Comment #2 from Andrei Alexandrescu and...@erdani.com 2013-10-23 09:53:31 
PDT ---
@Dicebot: yah, it's an enhancement. One of the spec as well :o). The .init
value can still exist, but the initialization doesn't need to use it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 11331] Inefficient initialization of struct with members = void

2013-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=11331



--- Comment #3 from Dicebot pub...@dicebot.lv 2013-10-23 09:55:29 PDT ---
(In reply to comment #2)
 @Dicebot: yah, it's an enhancement. One of the spec as well :o). The .init
 value can still exist, but the initialization doesn't need to use it.

Well, this sounds like quite an important change - I'd prefer this issue
description to tell more about possible implications of that spec change than
about generated assembly :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 11331] Inefficient initialization of struct with members = void

2013-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=11331



--- Comment #4 from Andrei Alexandrescu and...@erdani.com 2013-10-23 10:07:14 
PDT ---
http://dlang.org/struct.html mentions that Struct instances that are not
instantiated with a constructor are default initialized to their .init value.
and mentions that S() is same as auto b = S.init;

There is no guarantee about the values of the = void members in S.init, but
definitely the spec clarifies that two default-constructed objects will compare
equal. So we need to change the spec to only guarantee non-=void fields of
default-constructed objects to be equal.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---