coroutine-sleep: use a stack-allocated timer
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 17 May 2021 10:05:43 +0000 (12:05 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 21 May 2021 17:22:33 +0000 (18:22 +0100)
commit5b33e015d38acb00340b8310a24c9998138afbe6
tree61d4c60103900ce2a0afe316bdefba0f9b7e3f28
parent5c6ae58d4bdca71f0b63e854ceb6a8ee67cbddd8
coroutine-sleep: use a stack-allocated timer

The lifetime of the timer is well-known (it cannot outlive
qemu_co_sleep_ns_wakeable, because it's deleted by the time the
coroutine resumes), so it is not necessary to place it on the heap.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20210517100548.28806-2-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/qemu-coroutine-sleep.c