From f8b0a4dc3a87b3438292b3c1c3c224b63da75399 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 22 Jan 2002 21:48:26 +0000 Subject: [PATCH] this works, but it sucks Original commit message from CVS: this works, but it sucks --- gst/cothreads/test-pth-pthreads.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gst/cothreads/test-pth-pthreads.c b/gst/cothreads/test-pth-pthreads.c index d4818af..7121514 100644 --- a/gst/cothreads/test-pth-pthreads.c +++ b/gst/cothreads/test-pth-pthreads.c @@ -21,19 +21,14 @@ void cothread (void *unused) void pthread (void* unused) { pth_mctx_t ctx; - char *skaddr, *stackspace; + char *skaddr; printf ("1: saving the main context\n"); printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME); pth_mctx_save (&main_context); - printf ("1: %d\n", pthread_self()); - - stackspace = malloc(2 * 1024 * 1024); - memset (stackspace + 2 * 1024 * 1024 - sizeof(pthread_descr) - 1, &(thread_handle (pthread_self()))->h_descr, sizeof (pthread_descr)); - while (1) { - skaddr = stackspace; + skaddr = alloca (64 * 1024); printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME); printf ("1: spawning a new cothread\n"); -- 2.7.4