At the C API level, freeing a Futhark value can also return an error
code. This is not exposed in the Rust code, where the return code of
the freeing functions is never checked. This is likely because the
implicit resource management implied by the Drop trait is
incompatible with checking deallocations for errors. Futhark has no
documented reason for why deallocation should ever fail, and in
practice it will only occur due to compiler bugs, or perhaps driver or
hardware malfunction, and never under normal circumstances. Yet, it
would be better to check the error code, and perform a Rust panic in
the event of deallocation error.
At the C API level, freeing a Futhark value can also return an error code. This is not exposed in the Rust code, where the return code of the freeing functions is never checked. This is likely because the implicit resource management implied by the
Drop
trait is incompatible with checking deallocations for errors. Futhark has no documented reason for why deallocation should ever fail, and in practice it will only occur due to compiler bugs, or perhaps driver or hardware malfunction, and never under normal circumstances. Yet, it would be better to check the error code, and perform a Rustpanic
in the event of deallocation error.