[][src]Function solana_rbpf::helpers::gather_bytes

pub fn gather_bytes(
    arg1: u64,
    arg2: u64,
    arg3: u64,
    arg4: u64,
    arg5: u64,
    _context: &mut HelperContext,
    _ro_regions: &[MemoryRegion],
    _rw_regions: &[MemoryRegion]
) -> Result<u64, Error>

The idea is to assemble five bytes into a single u64. For compatibility with the helpers API, each argument must be a u64.

Examples

use solana_rbpf::helpers;
use solana_rbpf::memory_region::MemoryRegion;

let regions = [MemoryRegion::default()];
let gathered = helpers::gather_bytes(0x11, 0x22, 0x33, 0x44, 0x55, &mut None, &regions, &regions).unwrap();
assert_eq!(gathered, 0x1122334455);