From c4097c29512269f4547ebefb8abdc57a2892b479 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 11 May 2004 17:51:27 +0000 Subject: Fix small bugs. --- src/libthread/386.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/libthread/386.c') diff --git a/src/libthread/386.c b/src/libthread/386.c index d8052f09..2c611e45 100644 --- a/src/libthread/386.c +++ b/src/libthread/386.c @@ -15,7 +15,7 @@ launcher386(void (*f)(void *arg), void *arg) p = _threadgetproc(); t = p->thread; - _threadstacklimit(t->stk); + _threadstacklimit(t->stk, t->stk+t->stksize); (*f)(arg); threadexits(nil); @@ -39,18 +39,19 @@ _threadinswitch(int enter) USED(enter); #ifdef USEVALGRIND if(enter) - VALGRIND_SET_STACK_LIMIT(0, 0, 1); - else VALGRIND_SET_STACK_LIMIT(0, 0, 0); + else + VALGRIND_SET_STACK_LIMIT(0, 0, 1); #endif } void -_threadstacklimit(void *addr) +_threadstacklimit(void *bottom, void *top) { - USED(addr); + USED(bottom); + USED(top); #ifdef USEVALGRIND - VALGRIND_SET_STACK_LIMIT(1, addr, 0); + VALGRIND_SET_STACK_LIMIT(1, bottom, top); #endif } -- cgit v1.2.3