|
Revision 1577, 1.3 kB
(checked in by walter, 2 years ago)
|
remove documentation on module(system)
|
| Line | |
|---|
| 1 |
Ddoc |
|---|
| 2 |
|
|---|
| 3 |
$(SPEC_S The Memory Safe D Spec, |
|---|
| 4 |
|
|---|
| 5 |
$(P $(I Memory Safety) for a program is defined as it being |
|---|
| 6 |
impossible for the program to corrupt memory. |
|---|
| 7 |
Therefore, the Safe D consists only of programming language |
|---|
| 8 |
features that are guaranteed to never result in memory |
|---|
| 9 |
corruption. |
|---|
| 10 |
) |
|---|
| 11 |
|
|---|
| 12 |
$(P Safe D is enabled on a per-module basis by compiling with |
|---|
| 13 |
the $(B -safe) compiler switch. |
|---|
| 14 |
) |
|---|
| 15 |
|
|---|
| 16 |
<h3>Proscribed Forms</h3> |
|---|
| 17 |
|
|---|
| 18 |
$(UL |
|---|
| 19 |
$(LI $(LINK2 iasm.html, Inline assembler). |
|---|
| 20 |
) |
|---|
| 21 |
|
|---|
| 22 |
$(LI Casting away const or immutable attributes. |
|---|
| 23 |
) |
|---|
| 24 |
|
|---|
| 25 |
$(LI Casting away shared attributes. |
|---|
| 26 |
) |
|---|
| 27 |
|
|---|
| 28 |
$(LI Casting from one pointer type to another pointer type, |
|---|
| 29 |
except for: |
|---|
| 30 |
$(UL |
|---|
| 31 |
$(LI casting to $(CODE void*) is allowed) |
|---|
| 32 |
$(LI casting from a pointer to an arithmetic type to |
|---|
| 33 |
a pointer to another arithmetic type of the same or |
|---|
| 34 |
smaller size is allowed) |
|---|
| 35 |
) |
|---|
| 36 |
) |
|---|
| 37 |
|
|---|
| 38 |
$(LI Casting from a non-pointer type to a pointer type. |
|---|
| 39 |
) |
|---|
| 40 |
) |
|---|
| 41 |
|
|---|
| 42 |
$(P A safe module can import and use the public interface of |
|---|
| 43 |
a system module. |
|---|
| 44 |
) |
|---|
| 45 |
|
|---|
| 46 |
<h3>Limitations</h3> |
|---|
| 47 |
|
|---|
| 48 |
$(P Safe D does not imply that code is portable, uses only |
|---|
| 49 |
sound programming practices, is free of byte order dependencies, |
|---|
| 50 |
or other bugs. It is focussed only on eliminating memory corruption |
|---|
| 51 |
possibilities. |
|---|
| 52 |
) |
|---|
| 53 |
|
|---|
| 54 |
) |
|---|
| 55 |
|
|---|
| 56 |
Macros: |
|---|
| 57 |
TITLE=Memory-Safe-D-Spec |
|---|
| 58 |
WIKI=SafeDSpec |
|---|