A Refcounted Array Type

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 3 23:26:00 PST 2015


On Tuesday, 3 March 2015 at 18:38:11 UTC, Steven Schveighoffer 
wrote:
> int *myglobal;
>
> repeat same code, but access what myglobal points to instead of 
> setting to 42. Memory corruption is what @safe code is trying 
> to prevent. This would lead to memory corruption.

You mean, the class destructor accesses a GC-allocated memory? 
That's indeed unsafe, but unrelated to globals.


More information about the Digitalmars-d mailing list