This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Better allocator for wasm #1460
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2741554
Add Arch Linux installation instructions
cmichi e95140a
Enable tracing heap size
gavofyork d2a7935
Extract heap
cmichi aff276a
Replace linear allocator with buddy allocator
cmichi 292c177
Fix test
cmichi 1d71e15
Get rid of memcpy in to_vec()
cmichi b65f0e4
fixup: Style and comments
cmichi 02a3d1e
fixup: Split Linux instructions by distribution
cmichi dfa62a8
fixup: Remove unnecessary types and code
cmichi 41e4ab7
fixup: Make Pointers start from 1, remove some panics, code improvements
cmichi 53bf828
fixup: Return 0 on errors
cmichi b189736
fixup: Move loop to separate function
cmichi 18a1efc
fixup: Use FnvHashMap instead of HashMap
cmichi 137b5bd
fixup: Fix error handling
cmichi 741e972
fixup: Use current_size() instead of used_size()
cmichi 93dc2e9
fixup: Fix and document allocation offset
cmichi d4676b0
fixup: Remove unnecessary multiplication
cmichi 6a99426
fixup: Fix comments
cmichi 6725a49
fixup: Remove Arch installation instructions
cmichi 6438db3
Revert "Fix test"
cmichi ecd9731
fixup: Remove unused code, improve import
cmichi ca065b1
fixup: Proper alignment
cmichi 58ee588
fixup: Do not use internal constant in public description
cmichi 247d37b
fixup: Add comment regarding invariants
cmichi 8e4deda
fixup: Move assertion to compile-time check
cmichi 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
fixup: Add comment regarding invariants
- Loading branch information
commit 247d37b58367f52db27022c506025e9bb911670a
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
As was discussed in the issue, this actually violates formal preconditions required by
Vec::from_raw_parts(i.e. the pointer is allocated not withVecroutines). Given that we agree with it, I still would like to have a comment here mentioning this fact.And there should be another case nearby (below).
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'm still against using
Vec::from_raw_partsbecause of all the invariants. If we can prove the invariants, I'm happy.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.
@gavofyork What is your opinion on this?
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.
It may be better to return some other new type as well.
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.
As I stated in the other thread I'm against this UB dogma. I demonstrated that this code is safe. If you think otherwise please bring the argument forward, otherwise this code goes in.
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.
Yes, I'd agree that it would work for us and I don't have anymore to add to our discussion here! But I'd still be in favor of a comment here. I hope it will save us a headache.
Also, @cmichi there is another case where we apply the same pattern:
child_storage, a function below. I'd like them to be synchronized.