Skip to content

Commit

Permalink
coroutine: add a macro for the coroutine stack size
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
plieven authored and kevmw committed Sep 29, 2016
1 parent be87a39 commit 8adcd6f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/qemu/coroutine_int.h
Expand Up @@ -28,6 +28,8 @@
#include "qemu/queue.h"
#include "qemu/coroutine.h"

#define COROUTINE_STACK_SIZE (1 << 20)

typedef enum {
COROUTINE_YIELD = 1,
COROUTINE_TERMINATE = 2,
Expand Down
2 changes: 1 addition & 1 deletion util/coroutine-sigaltstack.c
Expand Up @@ -143,7 +143,7 @@ static void coroutine_trampoline(int signal)

Coroutine *qemu_coroutine_new(void)
{
const size_t stack_size = 1 << 20;
const size_t stack_size = COROUTINE_STACK_SIZE;
CoroutineSigAltStack *co;
CoroutineThreadState *coTS;
struct sigaction sa;
Expand Down
2 changes: 1 addition & 1 deletion util/coroutine-ucontext.c
Expand Up @@ -82,7 +82,7 @@ static void coroutine_trampoline(int i0, int i1)

Coroutine *qemu_coroutine_new(void)
{
const size_t stack_size = 1 << 20;
const size_t stack_size = COROUTINE_STACK_SIZE;
CoroutineUContext *co;
ucontext_t old_uc, uc;
sigjmp_buf old_env;
Expand Down
2 changes: 1 addition & 1 deletion util/coroutine-win32.c
Expand Up @@ -71,7 +71,7 @@ static void CALLBACK coroutine_trampoline(void *co_)

Coroutine *qemu_coroutine_new(void)
{
const size_t stack_size = 1 << 20;
const size_t stack_size = COROUTINE_STACK_SIZE;
CoroutineWin32 *co;

co = g_malloc0(sizeof(*co));
Expand Down

0 comments on commit 8adcd6f

Please sign in to comment.