Skip to content

Rollup of 9 pull requests #78386

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

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
95aac44
transmute_copy: explain that alignment is handled correctly
RalfJung Oct 11, 2020
08d5e96
Initialize tracing subscriber in compiletest tool
tmiasko Oct 20, 2020
2ec4d82
Add issue template link to IRLO
jonas-schievink Oct 20, 2020
95cbfb1
Retitle forum links
jonas-schievink Oct 20, 2020
57d01a9
Check which places are dead
simonvandel Oct 22, 2020
d0d0e78
Capture output from threads spawned in tests
tmandry Aug 5, 2020
db15596
Only load LOCAL_STREAMS if they are being used
SergioBenitez Oct 22, 2020
86df903
Tweak "use `.await`" suggestion
estebank Oct 21, 2020
a4ee3ca
Suggest semicolon removal on prior match arm
estebank Oct 22, 2020
671d7c4
Account for possible boxable `impl Future` in semicolon removal sugge…
estebank Oct 22, 2020
62ba365
Review comments: use newtype instead of `bool`
estebank Oct 22, 2020
3a0227b
Silence unnecessary `await foo?` knock-down error
estebank Oct 22, 2020
1829b4a
Add test case for different `impl Future`s
estebank Oct 22, 2020
c548511
Add more `.await` suggestions on E0308
estebank Oct 23, 2020
f5d7443
Suggest semicolon removal and boxing when appropriate
estebank Oct 23, 2020
d413bb6
`#[deny(unsafe_op_in_unsafe_fn)]` in sys/wasm
Jul 18, 2020
eed4510
Add some description for (malloc/calloc/free/realloc)
Oct 20, 2020
de87ae7
Add documents for DLMALLOC
Oct 24, 2020
d147f78
Fix unsafe operation of wasm32::memory_atomic_notify
Oct 24, 2020
d37b8cf
Remove unnecessary unsafe block from condvar_atomics & mutex_atomics
Oct 24, 2020
7b4c397
Do not try to report on closures to avoid ICE
JohnTitor Oct 23, 2020
4ec396e
Test with NLL explicitly
JohnTitor Oct 25, 2020
cabf6d0
Tweak `if let` suggestion to be more liberal with suggestion and to n…
estebank Sep 28, 2020
955c0c3
Rollup merge of #74477 - chansuke:sys-wasm-unsafe-op-in-unsafe-fn, r=…
Dylan-DPC Oct 26, 2020
34d2351
Rollup merge of #77283 - estebank:if-let-sugg, r=Mark-Simulacrum
Dylan-DPC Oct 26, 2020
46f9f01
Rollup merge of #77836 - RalfJung:transmute_copy, r=Mark-Simulacrum
Dylan-DPC Oct 26, 2020
2d189aa
Rollup merge of #78137 - tmiasko:compiletest-tracing, r=Mark-Simulacrum
Dylan-DPC Oct 26, 2020
f6d182b
Rollup merge of #78161 - jonas-schievink:irlo-issue-link, r=Mark-Simu…
Dylan-DPC Oct 26, 2020
bfb4439
Rollup merge of #78214 - estebank:match-semicolon, r=oli-obk
Dylan-DPC Oct 26, 2020
6b28db3
Rollup merge of #78227 - SergioBenitez:test-stdout-threading, r=m-ou-se
Dylan-DPC Oct 26, 2020
40d4db3
Rollup merge of #78247 - simonvandel:fix-78192, r=oli-obk
Dylan-DPC Oct 26, 2020
e86664e
Rollup merge of #78268 - JohnTitor:issue-78262, r=estebank
Dylan-DPC Oct 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some description for (malloc/calloc/free/realloc)
  • Loading branch information
chansuke committed Oct 24, 2020
commit eed45107da8da6293d9cecc302ad3b9870848b51
4 changes: 4 additions & 0 deletions library/std/src/sys/wasm/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@ static mut DLMALLOC: dlmalloc::Dlmalloc = dlmalloc::DLMALLOC_INIT;
unsafe impl GlobalAlloc for System {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
// SAFETY: DLMALLOC.malloc() is guranteed to be safe since lock::lock() aqcuire a globl lock
let _lock = lock::lock();
unsafe { DLMALLOC.malloc(layout.size(), layout.align()) }
}

#[inline]
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
// SAFETY: DLMALLOC.calloc() is guranteed to be safe since lock::lock() aqcuire a globl lock
let _lock = lock::lock();
unsafe { DLMALLOC.calloc(layout.size(), layout.align()) }
}

#[inline]
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
// SAFETY: DLMALLOC.free() is guranteed to be safe since lock::lock() aqcuire a globl lock
let _lock = lock::lock();
unsafe { DLMALLOC.free(ptr, layout.size(), layout.align()) }
}

#[inline]
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
// SAFETY: DLMALLOC.realloc() is guranteed to be safe since lock::lock() aqcuire a globl lock
let _lock = lock::lock();
unsafe { DLMALLOC.realloc(ptr, layout.size(), layout.align(), new_size) }
}
Expand Down