@@ -3065,11 +3065,11 @@ $(H3 $(LNAME2 system-functions, System Functions))
3065
3065
3066
3066
$(H3 $(LNAME2 safe-interfaces, Safe Interfaces))
3067
3067
3068
- $(P Given that it is only called with $(RELATIVE_LINK2 safe-values, safe
3068
+ $(P When it is only called with $(RELATIVE_LINK2 safe-values, safe
3069
3069
values) and $(RELATIVE_LINK2 safe-aliasing, safe aliasing), a
3070
3070
function has a safe interface when:)
3071
3071
$(OL
3072
- $(LI it cannot possibly exhibit
3072
+ $(LI it cannot exhibit
3073
3073
$(DDSUBLINK glossary, undefined_behavior, undefined behavior),
3074
3074
and)
3075
3075
$(LI it cannot create unsafe values that are accessible from other
@@ -3104,9 +3104,9 @@ $(H3 $(LNAME2 safe-interfaces, Safe Interfaces))
3104
3104
---
3105
3105
because they iterate pointers based on unverified assumptions
3106
3106
(`strlen` assumes that `s` is zero-terminated; `memcpy` assumes
3107
- that `dst` and `src` are at least `nbytes` long ). Any function
3107
+ that the memory objects pointed to by `dst` and `src` are at least `nbytes` big ). Any function
3108
3108
that traverses a C string passed as an argument can only be
3109
- `@system`. Any function that trusts a seperate parameter for
3109
+ `@system`. Any function that trusts a separate parameter for
3110
3110
array bounds can only be `@system`.
3111
3111
)
3112
3112
$(LI
@@ -3118,6 +3118,7 @@ $(H3 $(LNAME2 safe-interfaces, Safe Interfaces))
3118
3118
either a valid pointer, which is safe, or `null` which is also
3119
3119
safe. It returns a pointer to a fresh allocation, so it cannot
3120
3120
introduce any unsafe aliasing.
3121
+ $(NOTE The implementation of `malloc` is most likely @system code.)
3121
3122
)
3122
3123
$(LI
3123
3124
A D version of `memcpy` can have a safe interface:
@@ -3133,7 +3134,7 @@ $(H3 $(LNAME2 safe-interfaces, Safe Interfaces))
3133
3134
}
3134
3135
---
3135
3136
)
3136
- because the rules for safe $(RELATIVE_LINK2 safe-values, safe
3137
+ because the rules for $(RELATIVE_LINK2 safe-values, safe
3137
3138
values) ensure that the lengths of the arrays are correct.
3138
3139
)
3139
3140
)
0 commit comments