Skip to content

Commit

Permalink
thread_pthread.c: dup code
Browse files Browse the repository at this point in the history
* thread_pthread.c (get_stack): merge duplicated code split by ifdef.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Aug 28, 2013
1 parent 50b17c7 commit b7aa49b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions thread_pthread.c
Expand Up @@ -532,12 +532,11 @@ get_stack(void **addr, size_t *size)
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));
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
# endif
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
pthread_attr_destroy(&attr);
#elif (defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP) /* MacOS X */
pthread_t th = pthread_self();
Expand Down

0 comments on commit b7aa49b

Please sign in to comment.