Skip to content

Commit

Permalink
fix:remove unused memcpy function
Browse files Browse the repository at this point in the history
  • Loading branch information
irvingoujAtDevolution committed Dec 4, 2024
1 parent f002457 commit 53a2909
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
12 changes: 1 addition & 11 deletions cryptovec/src/platform/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,4 @@ pub fn memset(ptr: *mut u8, value: i32, size: usize) {
unsafe {
std::ptr::write_bytes(ptr, byte_value, size);
}
}

pub fn memcpy(dest: *mut u32, src: *const u8, size: usize) {
unsafe {
// Convert dest to *mut u8 for byte-wise copying
let dest_bytes = dest as *mut u8;

// Use std::ptr::copy_nonoverlapping to copy the data
std::ptr::copy_nonoverlapping(src, dest_bytes, size);
}
}
}
8 changes: 1 addition & 7 deletions cryptovec/src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ pub fn memset(ptr: *mut u8, value: i32, size: usize) {
unsafe {
libc::memset(ptr as *mut c_void, value, size);
}
}

pub fn memcpy(dest: *mut u32, src: *const u8, size: usize) {
unsafe {
libc::memcpy(dest as *mut c_void, src as *const c_void, size);
}
}
}

0 comments on commit 53a2909

Please sign in to comment.