1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* thread_pthread.c (get_stack): For NetBSD/FreeBSD, use

pthread_attr_getstack() if possible. and, remove an assumption
  of stack growing direction.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-07-04 13:27:31 +00:00
parent 1e8adda1fc
commit e6d42f34e2
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Mon Jul 4 22:24:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread_pthread.c (get_stack): For NetBSD/FreeBSD, use
pthread_attr_getstack() if possible. and, remove an assumption
of stack growing direction.
Mon Jul 4 20:42:31 2011 Yusuke Endoh <mame@tsg.ne.jp>
* ext/coverage/coverage.c: revert r32071. The commit caused SEGV on

View file

@ -479,9 +479,14 @@ get_stack(void **addr, size_t *size)
# elif defined HAVE_PTHREAD_ATTR_GET_NP /* FreeBSD, DragonFly BSD, NetBSD */
CHECK_ERR(pthread_attr_init(&attr));
CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr));
# ifdef HAVE_PTHREAD_ATTR_GETSTACK
CHECK_ERR(pthread_attr_getstack(&attr, addr, size));
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
# else
CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
CHECK_ERR(pthread_attr_getstacksize(&attr, size));
*addr = (char *)*addr + *size;
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
# endif
# else /* MacOS X */
pthread_t th = pthread_self();
*addr = pthread_get_stackaddr_np(th);