ruby-changes:13989
From: nobu <ko1@a...>
Date: Mon, 16 Nov 2009 18:55:50 +0900 (JST)
Subject: [ruby-changes:13989] Ruby:r25797 (mvm): * thread_pthread.c (get_stack): fixed stack start address on the
nobu 2009-11-16 18:55:31 +0900 (Mon, 16 Nov 2009) New Revision: 25797 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25797 Log: * thread_pthread.c (get_stack): fixed stack start address on the platforms using pthread_attr_t. Modified files: branches/mvm/ChangeLog branches/mvm/thread_pthread.c Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 25796) +++ mvm/ChangeLog (revision 25797) @@ -1,3 +1,7 @@ +Mon Nov 16 18:55:30 2009 <nobu@r...> + + * thread_pthread.c (get_stack): fixed stack start address on the + platforms using pthread_attr_t. Mon Nov 16 01:36:50 2009 Nobuyoshi Nakada <nobu@r...> * thread.c (rb_queue_shift_wait): added. Index: mvm/thread_pthread.c =================================================================== --- mvm/thread_pthread.c (revision 25796) +++ mvm/thread_pthread.c (revision 25797) @@ -230,28 +230,25 @@ # ifdef HAVE_PTHREAD_GETATTR_NP CHECK_ERR(pthread_getattr_np(pthread_self(), &attr)); -# ifdef HAVE_PTHREAD_ATTR_GETSTACK +# else + CHECK_ERR(pthread_attr_init(&attr)); + CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr)); +# endif +# ifdef HAVE_PTHREAD_ATTR_GETSTACK CHECK_ERR(pthread_attr_getstack(&attr, addr, size)); -# else +# else CHECK_ERR(pthread_attr_getstackaddr(&attr, addr)); CHECK_ERR(pthread_attr_getstacksize(&attr, size)); -# endif +# endif if (pthread_attr_getguardsize(&attr, &guard) == 0) { STACK_GROW_DIR_DETECTION; STACK_DIR_UPPER((void)0, *addr = (char *)*addr + guard); *size -= guard; } -# else - CHECK_ERR(pthread_attr_init(&attr)); - CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr)); - CHECK_ERR(pthread_attr_getstackaddr(&attr, addr)); - CHECK_ERR(pthread_attr_getstacksize(&attr, size)); -# endif - CHECK_ERR(pthread_attr_getguardsize(&attr, &guard)); + STACK_DIR_UPPER((void)0, *addr = (char *)*addr + *size); # ifndef HAVE_PTHREAD_GETATTR_NP pthread_attr_destroy(&attr); # endif - size -= guard; #elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP pthread_t th = pthread_self(); *addr = pthread_get_stackaddr_np(th); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/