On Friday, 22 May 2020 at 16:47:34 UTC, Steven Schveighoffer
wrote:
[snip]
You can't, you don't control that code, someone else does (this
is important, you can declare extern(C) functions anywhere,
even locally).
You can make a separate module with one function that just calls
the `free` function and has the @system attribute. Then, just
change the import for the free function to that new module.
Annoying, but potentially fix-able.
The bigger issue is that we know that we should check the `free`
function, but what about all the other functions out there that
might corrupt memory that we don't really know about. It's not
scale-able.
And from the experience of .save for forward ranges, people
just aren't going to do this. They are going to do the easiest
thing that works without complaint -- i.e. don't bother marking.
Probably true.