Add safety docs (#7665)

This commit is contained in:
Jack May
2020-01-03 09:14:28 -08:00
committed by GitHub
parent 078e7246ac
commit 6c544708e1
2 changed files with 2 additions and 0 deletions

View File

@ -1,6 +1,7 @@
//! @brief Solana Rust-based BPF program utility functions and types
#[no_mangle]
/// # Safety
pub unsafe fn sol_log_(message: *const u8, length: u64) {
let slice = std::slice::from_raw_parts(message, length as usize);
let string = std::str::from_utf8(&slice).unwrap();

View File

@ -27,6 +27,7 @@ pub const SUCCESS: u32 = 0;
#[macro_export]
macro_rules! entrypoint {
($process_instruction:ident) => {
/// # Safety
#[no_mangle]
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u32 {
unsafe {