-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use __heap_base by dlmalloc #114
Merged
sunfishcode
merged 10 commits into
WebAssembly:master
from
mikevoronov:dlmalloc_heap_base
Nov 5, 2019
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aa698a1
Merge pull request #1 from CraneStation/master
mikevoronov 93476e4
add explicit allocator initialization
mikevoronov 5b72609
move init to a better place
mikevoronov 72a6db1
fix warnings
mikevoronov 7d1e5ab
add __wasilibc_try_init_allocator
mikevoronov 8dbe4e2
move initialization to dlmalloc()
mikevoronov 403d4a9
fix typos
mikevoronov f858b48
fix identations
mikevoronov 2e4eee3
follow style guide
mikevoronov 5e70f07
review changes
mikevoronov 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ __floatsitf | |
__floatunsitf | ||
__getf2 | ||
__gttf2 | ||
__heap_base | ||
__letf2 | ||
__lttf2 | ||
__netf2 | ||
|
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.
Would it work to call this from within
init_mparams
instead? That way it'd get called for all entrypoints, not justmalloc
.In that case, it shouldn't do
ensure_initialization
itself, but just do its work afterinit_mparams
has done its work.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.
Hmmm, I've though about it, but there are some clues:
ensure_initialization
is used for mspace also (mspace is like arena in ptmalloc for different continuous space of allocations). At now, mspace is disabled, but if someone want to enable it, there will some unobvious problems. And it is logically incorrect.ensure_initialization
is disabled indlmalloc
, because it is inside#if USE_LOCKS
that is also disabled. And it is called intosys_alloc
. But for our purpose it is important to have it initialized before main logic of chunk choosing indlmalloc
being called. => in case ofensure_initialization
we will need two augmentation (intoensure_initialization
anddlmalloc
) instead of one in current case.dlmalloc
seems correct, because other entry points (realloc
,calloc
) in all important CFG paths will call it before any chunk manipulation. The only exception here isfree
, but it is UB to callfree
without any previousmalloc
.So, yes, it possible to move top chunk initialization into
ensure_initialization
, but it seems that it is better leave it as now.What do you think?
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.
Thanks for looking into that! I think what you have right now looks like a reasonable approach then.