digitalmars.D - std.variant holding bigger structs and std.concurrency message
- Tavi Cacina (19/19) Apr 27 2013 is it a bug the fact that a Variant may be initialized with a
- Idan Arye (7/26) Apr 27 2013 There used to be a maximum size check for placing things in
- David Eagen (3/6) Apr 29 2013 So is the bug in std.concurrency and they way it uses Variant or
- Anonimous (2/8) May 09 2013 Ping.
- David Nadlinger (3/9) May 09 2013 It's a variant bug, please make sure it is on Bugzilla.
- Anonimous (7/17) May 09 2013 Yes, it is reported by Tavi Cacina
- David Nadlinger (5/9) May 09 2013 Yep, things are only slowly getting back to normality as jet lag
is it a bug the fact that a Variant may be initialized with a struct bigger than 32 bytes? Even if this does function, it is not consistent because you can not assign such an 'inflated' variant to another one, assertion. This affects the max size of a std.concurrency message (right now it is not specified that such restriction exists) --- import std.variant; struct S { int[9] s; } void main() { Variant v1, v2; // maximum size 32 bytes v1 = S(); // works, even if sizeof(S) > 32 v2 = v1; // AssertError: target must be non-null } ---
Apr 27 2013
On Saturday, 27 April 2013 at 11:37:38 UTC, Tavi Cacina wrote:is it a bug the fact that a Variant may be initialized with a struct bigger than 32 bytes? Even if this does function, it is not consistent because you can not assign such an 'inflated' variant to another one, assertion. This affects the max size of a std.concurrency message (right now it is not specified that such restriction exists) --- import std.variant; struct S { int[9] s; } void main() { Variant v1, v2; // maximum size 32 bytes v1 = S(); // works, even if sizeof(S) > 32 v2 = v1; // AssertError: target must be non-null } ---There used to be a maximum size check for placing things in variants, but it was removed back in 2009: https://github.com/D-Programming-Language/phobos/commit/0c142994d9b5cb9f379eca28f3a625c749370e4a#L20L189 The way it works now, is that if the size is too big they use a reference instead: https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L544#L555
Apr 27 2013
On Saturday, 27 April 2013 at 17:42:54 UTC, Idan Arye wrote:The way it works now, is that if the size is too big they use a reference instead: https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L544#L555So is the bug in std.concurrency and they way it uses Variant or is the bug in Variant?
Apr 29 2013
On Tuesday, 30 April 2013 at 00:04:04 UTC, David Eagen wrote:On Saturday, 27 April 2013 at 17:42:54 UTC, Idan Arye wrote:Ping.The way it works now, is that if the size is too big they use a reference instead: https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L544#L555So is the bug in std.concurrency and they way it uses Variant or is the bug in Variant?
May 09 2013
On Tuesday, 30 April 2013 at 00:04:04 UTC, David Eagen wrote:On Saturday, 27 April 2013 at 17:42:54 UTC, Idan Arye wrote:It's a variant bug, please make sure it is on Bugzilla. DavidThe way it works now, is that if the size is too big they use a reference instead: https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L544#L555So is the bug in std.concurrency and they way it uses Variant or is the bug in Variant?
May 09 2013
On Thursday, 9 May 2013 at 12:36:36 UTC, David Nadlinger wrote:On Tuesday, 30 April 2013 at 00:04:04 UTC, David Eagen wrote:Yes, it is reported by Tavi Cacina http://d.puremagic.com/issues/show_bug.cgi?id=10017 Sorry,I ment that it's an important bug,but maybe everybody was busy with dconf and just didn't do anything with it. There is already pull,could you tell about its status?On Saturday, 27 April 2013 at 17:42:54 UTC, Idan Arye wrote:It's a variant bug, please make sure it is on Bugzilla. DavidThe way it works now, is that if the size is too big they use a reference instead: https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L544#L555So is the bug in std.concurrency and they way it uses Variant or is the bug in Variant?
May 09 2013
On Thursday, 9 May 2013 at 12:42:25 UTC, Anonimous wrote:Sorry,I ment that it's an important bug,but maybe everybody was busy with dconf and just didn't do anything with it.Yep, things are only slowly getting back to normality as jet lag wears off and the recordings are taken care of… ;)There is already pull,could you tell about its status?See my comment there. David
May 09 2013