Am 19.10.2013 09:12, schrieb Max Samukha:
On Saturday, 19 October 2013 at 07:02:21 UTC, Paulo Pinto wrote:
Am 19.10.2013 08:58, schrieb Max Samukha:
On Saturday, 19 October 2013 at 06:24:00 UTC, Paulo Pinto wrote:


There is nothing unsafe about this code snippet.


Sure. There is nothing unsafe in misusing __traits and extern(C) as
well.

There is if the result is

- memory corruption
- memory leaks no longer visible to the GC
- program crash
- ...

No problem, since that was the programmer's explicit purpose. C#
provides a ton of backdoors that could lead to what you mentioned in
your list.

That is why they have to :

- be marked unsafe
- be allowed by the security manager

In D's case it is no different, such code is only to be allowed in @system code and partilly in @thrusted.

--
Paulo

Reply via email to