std.uni.ReallocPolicy question
Eduard Staniloiu
edi33416 at gmail.com
Wed Dec 12 09:42:28 UTC 2018
Anybody knows why `std/uni.ReallocPolicy`'s `realloc` and
`destroy` are `@trusted`?
Those were introduced by this PR:
https://github.com/dlang/phobos/pull/6041/files
`realloc` and `destroy` are never `@safe` solely from their point
of view, as they don't know if there are any references to the
memory they are freeing. The caller has this information and he
can safely make the call to them `@trusted`.
Cheers,
Edi
More information about the Digitalmars-d
mailing list