digitalmars.D.learn - When is exception throwing nogc with -dip1008?
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (15/15) Jun 22 2020 Under what circumstances is exception throwing currently `@nogc`
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/6) Jun 22 2020 Found the postponed spec here:
- Mike Parker (2/7) Jun 22 2020 https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.md
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (8/9) Jun 22 2020 The spec says:
- Steven Schveighoffer (10/23) Jun 22 2020 My understanding is none.
Under what circumstances is exception throwing currently ` nogc` if the dmd flag `-dip1008` is used? For instance in code such as: void main() nogc { throw new Exception("I'm nogc now"); } Are all exceptions forced to be statically allocated when -dip1008 is used or can exception throwing be ` nogc` only when certain conditions hold? I can't find any docs on DIP-1008. The link https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md given in the release notes here Ref: https://dlang.org/changelog/2.079.0.html#dip1008 is broken.
Jun 22 2020
On Monday, 22 June 2020 at 13:59:22 UTC, Per Nordlöw wrote:I can't find any docs on DIP-1008. The link https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md is broken.Found the postponed spec here: https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.md
Jun 22 2020
On Monday, 22 June 2020 at 13:59:22 UTC, Per Nordlöw wrote:I can't find any docs on DIP-1008. The link https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md given in the release notes here Ref: https://dlang.org/changelog/2.079.0.html#dip1008 is broken.https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.md
Jun 22 2020
On Monday, 22 June 2020 at 14:10:15 UTC, Mike Parker wrote:https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.mdThe spec says: " The only place a refcounted Throwable is ever created is when the following statement is in the user code: throw new E(string); " What other typical throw cases will _not_ be allocated on the GC?
Jun 22 2020
On 6/22/20 10:36 AM, Per Nordlöw wrote:On Monday, 22 June 2020 at 14:10:15 UTC, Mike Parker wrote:My understanding is none. So for example: auto ex = new Exception(string); // heap allocated throw ex; It entirely depends on you immediately throwing the exception because otherwise, you may have stored a pointer elsewhere. Because classes (exceptions) cannot be truly refcounted on copy, you need a very controlled environment to ensure the ref-counting works. -Stevehttps://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.mdThe spec says: " The only place a refcounted Throwable is ever created is when the following statement is in the user code: throw new E(string); " What other typical throw cases will _not_ be allocated on the GC?
Jun 22 2020