WiresmithTech / Rust-LabVIEW-Interop

A crate for creating libraries in Rust that are called from LabVIEW
MIT License
7 stars 5 forks source link

UHandle from Uptr #24

Open jkneer opened 4 months ago

jkneer commented 4 months ago

For pointers that are known to point to a Handle, the handle can be recovered using DSRecoverHandle. Having this special case covered by the memory manager makes me wonder if the general Deref implementation UPtr<T> that also covers UPtr<UHandle> is safe, or if that dereference should be handled separately.

Also the implementation of the DSCheck functions (#23) may provide additional safeguards.

JamesMc86 commented 4 months ago

Lets keep this here for now but unless there is a specific use case for UPtr my intention was to not implement much of it as it is recommended to use handles instead and the call library node implements everything with handles and not pointers.