Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Use msg! in program entrypoint (bp #13889) #13891

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions sdk/program/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ macro_rules! entrypoint {
len: $crate::entrypoint::HEAP_LENGTH,
};

<<<<<<< HEAD
=======
/// A program can provide their own custom panic implementation by
/// adding a `custom-panic` feature to `Cargo.toml` and implementing
/// their own `custom_panic`.
///
/// A good way to reduce the final size of the program is to provide a
/// `custom_panic` implementation that does nothing. Doing so will cut
/// ~25kb from a noop program. That number goes down the more the
/// programs pulls in Rust's libstd for other purposes.
#[cfg(all(not(feature = "custom-panic"), target_arch = "bpf"))]
#[no_mangle]
fn custom_panic(info: &core::panic::PanicInfo<'_>) {
// Full panic reporting
$crate::msg!("{}", info);
}

>>>>>>> 57dd60f67... Use msg! in program entrypoint (#13889)
/// # Safety
#[no_mangle]
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
Expand Down