Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5ec9d34 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add HardwareBuffer::as_raw for C FFI boundary" into main am: fff76ea8 am: afd518e2

parents d0041218 afd518e2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -220,7 +220,13 @@ impl HardwareBuffer {
        Self(buffer)
    }

    /// Get the internal |AHardwareBuffer| pointer without decrementing the refcount. This can
    /// Get the internal `AHardwareBuffer` pointer that is only valid when this `HardwareBuffer`
    /// exists. This can be used to provide a pointer to the AHB for a C/C++ API over the FFI.
    pub fn as_raw(&self) -> NonNull<AHardwareBuffer> {
        self.0
    }

    /// Get the internal `AHardwareBuffer` pointer without decrementing the refcount. This can
    /// be used to provide a pointer to the AHB for a C/C++ API over the FFI.
    pub fn into_raw(self) -> NonNull<AHardwareBuffer> {
        let buffer = ManuallyDrop::new(self);