Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
SkillfulElectro authored Sep 10, 2024
1 parent f6e2f28 commit cb3a2c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,9 @@ pub extern "C" fn compute(kernel : *mut CKernel , data_for_gpu : *mut GroupOfBin


unsafe {
// let mapped_data_ptr = mapped_data.as_ptr();
// let data: &[u8] = unsafe { std::slice::from_raw_parts(mapped_data_ptr , binder.data_len) };
let tmp_box : Box<[u8]> = mapped_data.into();
let mapped_data_ptr = mapped_data.as_ptr();
let data: &[u8] = unsafe { std::slice::from_raw_parts(mapped_data_ptr , binder.data_len) };
let tmp_box : Box<[u8]> = data.into();
*binder.data = tmp_box.as_ptr() as *mut u8;
std::mem::forget(tmp_box);
}
Expand Down

0 comments on commit cb3a2c7

Please sign in to comment.