Skip to content
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

wasi-libc: use __heap_end if available #14273

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

jedisct1
Copy link
Contributor

The symbol was introduced in LLD 15.0.7, as a way to know how much memory can be allocated:

llvm/llvm-project@1095870

WebAssembly/wasi-libc#377

The symbol was introduced in LLD 15.0.7, as a way to know how
much memory can be allocated:

llvm/llvm-project@1095870
WebAssembly/wasi-libc#377
@Luukdegram
Copy link
Member

It would be nice if std's WasmPageAllocator would make use of the __heap_base and __heap_end symbols in the future to prevent unnecessary page allocations when there's still enough space left in the available memory. It would be safe to use those symbols as the linker will always ensure they are available. (I just implemented them in the in-house linker also, which should have a PR up tomorrow).

@jedisct1 jedisct1 enabled auto-merge (squash) January 12, 2023 11:24
@jedisct1
Copy link
Contributor Author

I just implemented them in the in-house linker also, which should have a PR up tomorrow

Hahah, I was about to ask you about that. Nice! 👍

@jedisct1 jedisct1 merged commit cbbf8c8 into ziglang:master Jan 12, 2023
@jedisct1 jedisct1 deleted the wasi-libc-heap_end branch January 12, 2023 16:19
matu3ba pushed a commit to matu3ba/zig that referenced this pull request Jan 15, 2023
The symbol was introduced in LLD 15.0.7, as a way to know how
much memory can be allocated:

llvm/llvm-project@1095870
WebAssembly/wasi-libc#377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants