Emphasize that Bigarray.int refers to the OCaml int type, and not the C int type#12298
Merged
Conversation
Octachron
reviewed
Jun 20, 2023
Octachron
reviewed
Jun 20, 2023
Contributor
Author
|
Sorry, this PR must've gotten lost in my inbox. I've updated it now, I think it also needs the |
Octachron
reviewed
Jul 15, 2024
Member
|
I would prefer if you added a Changes entry, documentation improvements are important improvements. |
c7d8731 to
8bee3b0
Compare
Signed-off-by: Edwin Török <edwin@etorok.net>
This is mentioned in the 'Element kinds' documentation, but that is not visible anywhere in LSP documentation completions. It is worth emphasizing this, because getting this wrong may lead to memory corruption. Suggested-by: Florian Angeletti <<florian.angeletti@inria.fr>> Signed-off-by: Edwin Török <edwin@etorok.net>
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Contributor
Author
|
I fixed the conflicts in |
Member
|
The ordering of Changes entries is not strictly enforced, but moving around the change entry looks fine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is already documented in 'element kinds', but I think it is worth emphasizing, because it can lead to bugs like yallop/ocaml-ctypes#744 if the C and OCaml types for 'int' are mixed up.
On Linux x86-64 they are of different sizes (8 bytes vs 4), and this can lead to memory corruption if one is not careful,
in fact the closest C type here would be
size_t, and there is no bigarray that would map a Cint*in a platform-independent way.