-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Tensor from_raw_parts #198
Changes from all commits
28a65a4
a2a0ad5
bd3353e
3d9e8be
e7de7b7
6925ec9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,14 @@ | |
/// | ||
/// The pointer must be non-null and the layout must be correct. | ||
#[allow(clippy::not_unsafe_ptr_arg_deref)] | ||
fn dealloc(&self, ptr: *mut u8, layout: Layout) { | ||
Check warning on line 77 in crates/kornia-tensor/src/allocator.rs GitHub Actions / Check
Check warning on line 77 in crates/kornia-tensor/src/allocator.rs GitHub Actions / Test Suite - x86_64-unknown-linux-gnu
Check warning on line 77 in crates/kornia-tensor/src/allocator.rs GitHub Actions / Test Suite - i686-unknown-linux-gnu
|
||
unsafe { alloc::dealloc(ptr, layout) } | ||
//println!("[allocator] {:?} attempting to deallocate pointer", ptr); | ||
|
||
// Check for null pointer | ||
if !ptr.is_null() { | ||
//unsafe { alloc::dealloc(ptr, layout) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gbin by commenting this line seems to do the job but i don't think it's correct. The behavior I'm seeing is that I never enter in this branch statement but gstreamer tries to allocate an invalid pointer. A bit weird -- might be missing something fundamental ? |
||
//println!("[allocator] {:?} successfully deallocated pointer", ptr); | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbin having a bit of trouble by trying to prevent gstreamer to deallocate the buffer. Do you have any insights here ?