JIT: Assume allocations succeed (#82961)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Mon, 6 Mar 2023 14:32:03 +0000 (15:32 +0100)
committerGitHub <noreply@github.com>
Mon, 6 Mar 2023 14:32:03 +0000 (15:32 +0100)
commitc0765d33251414ec276cbde2629f9b49b00059ab
tree257e832eca8c18f5e7e4c22e57f5ade747c0247d
parentc7537bdf261a7160836447ec46e1f136580a9fe4
JIT: Assume allocations succeed (#82961)

We call a NOMEM function when allocations fail that is already marked as
no-return, but at least MSVC is not able to pick up on this fact. The
result is that all operator new calls end up with an unnecessary null
check. This adds a COMPILER_ASSUME to allow compilers to recognize
that allocations never fail.

There was also a workaround for an old VSW bug that I've removed.
src/coreclr/inc/unreachable.h
src/coreclr/jit/alloc.h