-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix confusing sentence "without assuming architecture dependent alignment of the addresses" (#5342) #5063
base: main
Are you sure you want to change the base?
Fix confusing sentence "without assuming architecture dependent alignment of the addresses" (#5342) #5063
Conversation
Docs Build status updates of commit b4443d7: 🕙 Pending: waiting for processors (17 builds ahead of you) |
Docs Build status updates of commit b4443d7: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
I don't think the suggested corrections add clarity. If we wanted to clarify matters, I think this phrasing flows better:
|
Do you mean that "succeed" is more clarity than "correctly" or "not properly aligned" is clarity than "unaligned" ? Adding "for values of type T" sounds good. I care about preserving original sentence's replacabillity. In my correction, any of "unaligned" variant's summary was created by just adding "correctly even while we use the platform which requires alignment and (any of) the given location is unaligned" to "aligned" method's summary. At least, any of new correction(mine or yours) is far much clarity than current document.(IMHO) |
@RamType0 I believe we should use @GrabYourPitchforks suggestion. The change as is I find more confusing. |
I think his phrase is OK, but I don't know which phrase of mine making it confusing. |
Do you think my phrase is more confusing than current? IMHO, @GrabYourPitchforks's phrase is greater than current, but it is not greater than mine, and not lesser than mine. Is there any non-native English speaker in reviewer? |
Sure, let's break it down. I've added [ ] brackets around your text to help group constructs. [Copies bytes from the source address to the destination address correctly] [even while we use the platform which requires alignment] [and any of the given location is unaligned]. The sentence communicates three separate ideas, as bracketed above. For improved readability, it's preferred to separate out the most important idea. Additional sentences can communicate extra information. This guideline suggests that the first idea should be its own sentence: "Copies bytes from the source address to the destination address correctly." However, it's awkward to describe a method as performing some operation "correctly." Most developers would expect .NET APIs to behave correctly. Let's keep that in mind for now and move on to the next part. The next two ideas communicate that: (a) some platforms require alignment; and (b) there may be memory locations which are unaligned. These statements feel redundant. If a value is at an unaligned memory location, then by definition, the value's location violates the platform's normal alignment assumptions. This implies that we can eliminate the middle idea ("even while..."). Now we come back to the "correctly" aspect from earlier. The important part of the "correctly" statement isn't that the method behaves correctly. (Developers would naturally expect this.) Instead, the important part is that the method behaves correctly even when the values are not aligned. That's what makes these methods unique compared to standard read / write / copy methods. This implies that the "correctly" word should be joined to the idea that some memory locations are unaligned. Since the first sentence of the text already communicates the core idea that the method reads / writes / copies bytes, we should move the "correctly" word to the second sentence. With these changes, we end up with (paraphrased):
The rest is technical cleanup (using more accurate terminology), tailoring the wording for the target audience, and grammatical corrections. Hope this helps explain things! |
@GrabYourPitchforks Thanks for great description! BTW, I heard it is ensured that primitive types with size lesser than 4bytes or pointer types are always read or written atomically. |
This depends on the processor. For x86 / x64 processors, if the integral value is appropriately aligned for the target address, the read / write is guaranteed atomic.
This is not necessary. The APIs discussed in this issue deal only with alignment concerns, not atomicity. The target developer for this API is somebody who needs low-level access to memory. It should be assumed such a person is intimately familiar with memory ordering models, platform alignment requirements, and similar concepts. We don't need to describe every guarantee or non-guarantee provided by these APIs beyond those in the API's immediate purview. For an example of API documentation which does describe atomicity guarantees, see |
b4443d7
to
2d7191a
Compare
Docs Build status updates of commit 2d7191a: ❌ Validation status: errorsPlease follow instructions here which may help to resolve issue.
xml/System.Runtime.CompilerServices/Unsafe.xml
For more details, please refer to the build report. If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. For any questions, please:
|
…ment of the addresses" (dotnet#5342)
2d7191a
to
829715d
Compare
Docs Build status updates of commit 829715d: ❌ Validation status: errorsPlease follow instructions here which may help to resolve issue.
xml/System.Runtime.CompilerServices/Unsafe.xml
For more details, please refer to the build report. If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. For any questions, please:
|
I've fixed some sentences with following your instructions. But I've felt some other missing description in document.
|
Sorry for my bad knowledge, how can I create a link in summary?
It is forbidden
Error occurred while starting Teams web app with following information. Request Id: 2451e15b-3537-425d-af87-c122e9ba5701 |
The Also, apologies about those internal help links. I've filed a suggestion that they also include a link to the public contributor's guide in those PR comments. (Although that guide doesn't seem to include any API ref-specific guidance.) |
This is clearly documented. From ECMA-335, III.3.30: "The behavior of cpblk is unspecified if the source and destination areas overlap." We don't need to mirror the entirety of the ECMA text into our docs here. These APIs are meant for developers who need to emit specific IL instructions into their apps. It's reasonable to expect callers to have read the appropriate specs. Honestly I think we're starting to go down a rabbit hole here. In an ideal world we'd have all docs easily approachable and understandable by a wide developer audience, but these are not APIs for a broad audience. There is intentionally some amount of gatekeeping in this API surface. We hide these APIs (and name them "unsafe"!) for good reason. |
@GrabYourPitchforks How about just adding link to |
Co-authored-by: Genevieve Warren <[email protected]>
Learn Build status updates of commit 9c3e312: ❌ Validation status: errorsPlease follow instructions here which may help to resolve issue.
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. For any questions, please:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @RamType0!
Was just looking at one commit instead of all changes. The changes need to be applied to across the PR.
Fixes #5342