DIP1000: Memory Safety in a Modern System Programming Language Pt.1

Dukc ajieskola at gmail.com
Wed Jun 22 21:58:47 UTC 2022


On Wednesday, 22 June 2022 at 20:48:13 UTC, Steven Schveighoffer 
wrote:
> On 6/21/22 11:05 AM, Mike Parker wrote:
> The part about `scope` being shallow. This is a problem.
>
> Is there any plan to address this other than "just use 
> `@system`"?
>
> -Steve

I think a custom `struct` containing a GC:d slice of `scope` 
arrays could be done. The struct itself needs `@system` code of 
course but could be `@safe` from outwards perspective, unless 
there's some issue I haven't thought of.

A relatively quick-and-dirty solution would be to use a static 
array for this, if you know some upper size the array can't 
exceed. Kinda cheap but probably better than `@system`.


More information about the Digitalmars-d-announce mailing list