Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引数のVoicevoxUserDictWord*がunalignedであることを許す #601

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

qryxip
Copy link
Member

@qryxip qryxip commented Sep 8, 2023

内容

#534 の方針を継続し、FIXMEとしていた部分を解消します。

関連 Issue

その他

というよりVoicevoxUserDictWordはby valueで渡した方がよいかもしれません。

@@ -956,6 +956,7 @@ pub struct VoicevoxUserDict {
}

/// ユーザー辞書の単語。
#[derive(Clone, Copy)]
Copy link
Member Author

@qryxip qryxip Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここは実は無くても動く(初めて知った)、がread(_unaligned)CopyしてはいけないオブジェクトをCopyしてしまったら流石にUBなので、ドキュメンテーション的な観点から付けておくことにする。

read creates a bitwise copy of T, regardless of whether T is Copy. If T is not Copy, using both the returned value and the value at *src can violate memory safety. Note that assigning to *src counts as a use because it will attempt to drop the value at *src.

@qryxip qryxip requested a review from Hiroshiba September 8, 2023 19:01
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちゃんとわかってないですけど、LGTM!!!

@Hiroshiba Hiroshiba merged commit 22b46cd into VOICEVOX:main Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants