Drawbacks of exceptions being globally allocated

Tejas notrealemail at gmail.com
Sat Aug 14 11:41:36 UTC 2021


What is the drawback of the following "simple" ```@nogc``` 
exception creation technique?

```d
import std;
void main()@nogc
{
     try{
         __gshared a = new Exception("help");
         scope b = a;
         throw b;
     }
     catch(Exception e){
         printf("caught");
     }
}
```


More information about the Digitalmars-d-learn mailing list