cold was necessary on try_initialize_nodrop to get more straight line asm

This commit is contained in:
tyler 2019-05-11 10:14:40 -07:00
parent 1a7f774914
commit c3241d0ba0

View file

@ -432,6 +432,7 @@ pub mod fast {
// performed for every call to `Key::get`.
// LLVM issue: https://bugs.llvm.org/show_bug.cgi?id=41722
#[inline(never)]
#[cold]
unsafe fn try_initialize_drop<F: FnOnce() -> T>(&self, init: F) -> Option<&'static T> {
// We don't put a `needs_drop` check around this and call it a day
// because this function is not inlined. Unwrapping code gets