-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Alignment of the bytes
of Allocation
to match align
parameter
#100467
Closed
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
0fe75b8
Stop x.py from being mean
maurer f37fe37
DO NOT MERGE - scratchwork
maurer fde4235
point to my miri fork
e0e8e00
no more direct hole punch to alloc bytes
a7b7f19
no more holepunch to bytes
f7a991b
commented out alignment check for int-aligned addrs -- need to make t…
e2ed272
proper check for size of allocation being aligned
51269b8
using the align parameter to properly align allocations
bca203e
redoing allocation bytes realignment -- still testing with miri
0ddff36
allocation bytes alignment, and cleanup .gitmodules
a72a057
double free detected in tcache 2: could not compile core in stage 1 c…
04f29dc
using slice directly, no intermediate vec
2fd7606
removing miri submodule updates
ab1a61f
removing miri submodule updates
b87f5ef
removing miri submodule updates
cade1c1
going back to previous version of miri to match commit of rustc
c31d404
moving AllocBytes into a trait -- partially done
emarteca e993680
more moving allocbytes into trait
emarteca 17ac36b
allocbytes moved into a trait, implemented for `Box<[u8]>` as default
emarteca c2e142b
merging in changes from upstream master
emarteca 99f6708
cleanup
emarteca a12d111
cleanup
emarteca f75649b
propagating Allocation Bytes type
emarteca 8db066f
adding deref and derefmut to allocbytes, removing now unnecessary met…
emarteca f075a12
nit
emarteca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
no more direct hole punch to alloc bytes
- Loading branch information
There are no files selected for viewing
This file contains 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
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.
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.
This is deliberately the host address, right? So it should have return type
usize
, notSize
.Also, to actually allow C code to use this address, we need to be a bit more careful with aliasing here. The pointer you are exposing here will be invalidated the next time someone mutates this memory, causing UB in Miri itself due to violating the Rust aliasing rules.
Under my proposal where
bytes: Bytes
, I think theAllocationBytes
trait should have a methodexpose_base_addr
with return typeusize
, and this function here simply callsexpose_base_addr
. (It should probably also be calledexpose_base_addr
.)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.
Good point -- thanks for the suggestion, that makes sense --
AllocationBytes
trait is a clean solution.