perf: Change underlying Elems to *const u8 (#29089)

* perf: Change underlying Elems to *const u8

* Remove clippy allows
This commit is contained in:
Jon Cinque 2022-12-06 18:06:27 +01:00 committed by GitHub
parent 94a6665995
commit 504091f9be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -224,14 +224,13 @@ pub fn verify_shreds_gpu(
let mut out = recycler_cache.buffer().allocate("out_buffer");
out.set_pinnable();
elems.push(perf_libs::Elems {
#[allow(clippy::cast_ptr_alignment)]
elems: pubkeys.as_ptr() as *const solana_sdk::packet::Packet,
elems: pubkeys.as_ptr().cast::<u8>(),
num: num_packets as u32,
});
for batch in batches {
elems.push(perf_libs::Elems {
elems: batch.as_ptr(),
elems: batch.as_ptr().cast::<u8>(),
num: batch.len() as u32,
});
let mut v = Vec::new();
@ -352,14 +351,13 @@ pub fn sign_shreds_gpu(
signatures_out.set_pinnable();
signatures_out.resize(total_sigs * sig_size, 0);
elems.push(perf_libs::Elems {
#[allow(clippy::cast_ptr_alignment)]
elems: pinned_keypair.as_ptr() as *const solana_sdk::packet::Packet,
elems: pinned_keypair.as_ptr().cast::<u8>(),
num: num_keypair_packets as u32,
});
for batch in batches.iter() {
elems.push(perf_libs::Elems {
elems: batch.as_ptr(),
elems: batch.as_ptr().cast::<u8>(),
num: batch.len() as u32,
});
let mut v = Vec::new();

View File

@ -3,7 +3,6 @@ use {
dlopen::symbor::{Container, SymBorApi, Symbol},
dlopen_derive::SymBorApi,
log::*,
solana_sdk::packet::Packet,
std::{
env,
ffi::OsStr,
@ -16,7 +15,7 @@ use {
#[repr(C)]
pub struct Elems {
pub elems: *const Packet,
pub elems: *const u8,
pub num: u32,
}

View File

@ -768,7 +768,7 @@ pub fn ed25519_verify(
let mut num_packets: usize = 0;
for batch in batches.iter() {
elems.push(perf_libs::Elems {
elems: batch.as_ptr(),
elems: batch.as_ptr().cast::<u8>(),
num: batch.len() as u32,
});
let v = vec![0u8; batch.len()];