-
Notifications
You must be signed in to change notification settings - Fork 2
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
WIP: Replace all memory allocations with fallible allocations and swap the… #29
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a31413e
Replace all memory allocations with fallible allocations and swap the…
ahomescu 881affe
Add comment on alignment requirements
ahomescu 0f4179d
Remove casts for FREE macro calls
ahomescu 0f45eea
Add MALLOC![T; N] form of MALLOC macro that allocates arrays of a giv…
ahomescu fbfd002
Add MALLOC!(@T) form that allocates a single object of the given type
ahomescu 5b429c0
Replace some more raw MALLOCs with the array form
ahomescu faf0905
Add type-safe version of REALLOC macro that uses Layout
ahomescu 48c2fbb
Replace direct calls to allocation functions with calls to MALLOC/FRE…
ahomescu 101112a
Remove allocator_api feature from runtests.rs
ahomescu e8a3100
Add a TODO on removing the boxes inside the hash maps
ahomescu 61777a9
Merge branch 'master' into swap_runtests_alloc
ahomescu 7f85078
Use the INIT_DATA_BUF_SIZE const instead of the numeric value when al…
ahomescu cd6b377
Use a few more consts instead of literals in calls to MALLOC
ahomescu 51f3925
Replace one literal with const in REALLOC macro use
ahomescu 4bce612
Directly initialize m_tempPool and m_temp2Pool as members of parser
ahomescu 98552df
Merge branch 'master' into swap_runtests_alloc
ahomescu 7f0610f
Merge branch 'master' into swap_runtests_alloc
ahomescu 32a2248
Remove OldEncoding structure
ahomescu f12979b
Use unimplemented! to abort if the user passes in a custom memory all…
ahomescu 26ffcec
Reduce the number of lookups in hash_insert! by folding the contains_…
ahomescu 19bceea
Revert "Remove OldEncoding structure"
ahomescu 6336948
Revert "Revert "Remove OldEncoding structure""
ahomescu c86e9ee
Merge branch 'master' into swap_runtests_alloc
ahomescu 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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.
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.
Don't we want to not add nightly features?
If we do add them, be sure to update #18
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.
Reading rust-lang/rust#55724 (comment) makes me think they'll stabilize more of
Layout
soon. There's also been some recent discussion on stabilizingtry_reserve
.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.
One alternative Stephen and I were discussing earlier is to have a
nightly
orfallible
feature that conditionally enables fallible allocation, and fall back to panics if building for stable Rust. We really, really need the nightly features forruntests
, but could allow panics outside of that.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.
I just realized something else:
alloc_layout_extra
is temporary, since once we replace all pointers with slices/boxes/etc we won't need to manually allocate any memory, so that feature will go away. We'll still needtry_reserve
, but we can enable that conditionally.