about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-04-02 19:57:28 +0200
committerGitHub <noreply@github.com>2021-04-02 19:57:28 +0200
commit48ebad58b2d1c07769d8bcaae076f760151fefd5 (patch)
tree1781e065ec5caf7fb79486e5956665350f402d6c /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent36bcf4069717b9dff90270d13b53a3b130329960 (diff)
parentdb1d003de1657e31174fac2bfa016000294ea266 (diff)
downloadrust-48ebad58b2d1c07769d8bcaae076f760151fefd5.tar.gz
rust-48ebad58b2d1c07769d8bcaae076f760151fefd5.zip
Rollup merge of #83065 - CDirkx:win-alloc, r=dtolnay
Rework `std::sys::windows::alloc`

I came across https://github.com/rust-lang/rust/pull/76676#discussion_r488729990, which points out that there was unsound code in the Windows alloc code, creating a &mut to possibly uninitialized memory. I reworked the code so that that particular issue does not occur anymore, and started adding more documentation and safety comments.

Full list of changes:
 - moved and documented the relevant Windows Heap API functions
 - refactor `allocate_with_flags` to `allocate` (and remove the other helper functions), which now takes just a `bool` if the memory should be zeroed
 - add checks for if `GetProcessHeap` returned null
 - add a test that checks if the size and alignment of a `Header` are indeed <= `MIN_ALIGN`
 - add `#![deny(unsafe_op_in_unsafe_fn)]` and the necessary unsafe blocks with safety comments

I feel like I may have overdone the documenting, the unsoundness fix is the most important part; I could spit this PR up in separate parts.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions