issues
search
spacemeshos
/
svm
SVM - Spacemesh Virtual Machine
https://spacemesh.io
MIT License
86
stars
14
forks
source link
Safer C APIs
#351
Closed
neysofu
closed
3 years ago
neysofu
commented
3 years ago
See #260.
Use
#![deny(unsafe_op_in_unsafe_fn)]
, which makes auditing
unsafe
code much easier.
Use method-based casting on raw pointers rather than
as
. Behavior is better documented and they protect against
NULL
deference.
Try to push
unsafe
code as high as possible within function bodies to highlight what
unsafe
operations we do.
Cast pointers to reference as early as possible as they are the main cause of
unsafe
.
See #260.
#![deny(unsafe_op_in_unsafe_fn)]
, which makes auditingunsafe
code much easier.as
. Behavior is better documented and they protect againstNULL
deference.unsafe
code as high as possible within function bodies to highlight whatunsafe
operations we do.unsafe
.