Simplify via zerocopy::FromZeros::new_box_zeroed - #919
Conversation
|
I see that the |
There was a problem hiding this comment.
Overall seems good to me, thanks Leon! Minor stylistic thing: prefer SAFETY: ... comment rather than # Safety\n\n... comment when discharging a safety obligation.
Also, fwiw, maybe we should use FromZeros::new_box_zeroed instead of the current body? Might need to tweak Cargo.toml to pull in the alloc feature, but since we're depending on alloc anyways, that's not an issue. Thoughts?
If we do not use the new_box_zeroed, then yes, we'd need to update the ratchet for this, thanks for confirming.
|
Agreed, |
3c8b0e8 to
9623f36
Compare
|
Jay Bosamiya (Microsoft) (@jaybosamiya-ms) Finally got around to this after #817 merged, sorry for the delay. Switched to |
This comment was marked as off-topic.
This comment was marked as off-topic.
litebox_{platform_lvbs,shim_optee}: simplify box_new_zeroedlitebox_common_linux: switch to zerocopy's FromZeros::new_box_zeroed
Jay Bosamiya (Microsoft) (jaybosamiya-ms)
left a comment
There was a problem hiding this comment.
LGTM, thanks for the cleanup Leon! I'll clean up the PR description before merging, since the merge queue uses it as the commit message
litebox_common_linux: switch to zerocopy's FromZeros::new_box_zeroedzerocopy::FromZeros::new_box_zeroed
The existing implementation of
box_new_zeroedwas unnecessarily complex. This PR simplifies it.