Add sol_log_compute_units syscall
This commit is contained in:
@@ -96,3 +96,19 @@ pub fn sol_log_params(accounts: &[AccountInfo], data: &[u8]) {
|
||||
info!("Instruction data");
|
||||
sol_log_slice(data);
|
||||
}
|
||||
|
||||
/// Logs the current compute unit consumption
|
||||
#[inline]
|
||||
pub fn sol_log_compute_units() {
|
||||
#[cfg(target_arch = "bpf")]
|
||||
unsafe {
|
||||
sol_log_compute_units_();
|
||||
}
|
||||
#[cfg(not(target_arch = "bpf"))]
|
||||
crate::program_stubs::sol_log_compute_units();
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "bpf")]
|
||||
extern "C" {
|
||||
fn sol_log_compute_units_();
|
||||
}
|
||||
|
Reference in New Issue
Block a user