Open
Description
At first I thought MaybeUninit
isn't used out of paranoia but now I realized it was because of MSRV. We can use it now. There's a bunch of places where it should be usable - mainly out parameters in C functions.
Pros/cons/thoughts:
- Faster, even without cross-language LTO
- Probably less burden on optimizer
- Expresses the intent better
- Another possible source of UB, but should be simple to handle
- We have to make sure the C library overwrites the memory - maybe we need to ask for guarantees upstream
- Things like "left in unspecified state if fails" are OK we just have to call
assume_init
only on success - Perhaps we can improve things using a macro
I personally prefer to do it if upstream can guarantee at least that if a call succeeds the memory is fully overwritten.
Metadata
Metadata
Assignees
Labels
No labels