Add safety docs (#7665)
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
//! @brief Solana Rust-based BPF program utility functions and types
|
//! @brief Solana Rust-based BPF program utility functions and types
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
/// # Safety
|
||||||
pub unsafe fn sol_log_(message: *const u8, length: u64) {
|
pub unsafe fn sol_log_(message: *const u8, length: u64) {
|
||||||
let slice = std::slice::from_raw_parts(message, length as usize);
|
let slice = std::slice::from_raw_parts(message, length as usize);
|
||||||
let string = std::str::from_utf8(&slice).unwrap();
|
let string = std::str::from_utf8(&slice).unwrap();
|
||||||
|
@ -27,6 +27,7 @@ pub const SUCCESS: u32 = 0;
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! entrypoint {
|
macro_rules! entrypoint {
|
||||||
($process_instruction:ident) => {
|
($process_instruction:ident) => {
|
||||||
|
/// # Safety
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u32 {
|
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u32 {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Reference in New Issue
Block a user