From 33ce920857405d4f4b342c85b74588a15e2702e5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 7 Nov 2016 20:47:24 -0500 Subject: simplify pthread_attr_t stack/guard size representation previously, the pthread_attr_t object was always initialized all-zero, and stack/guard size were represented as differences versus their defaults. this required lots of confusing offset arithmetic everywhere they were used. instead, have pthread_attr_init fill in the default values, and work with absolute sizes everywhere. --- src/thread/pthread_attr_setstacksize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/thread/pthread_attr_setstacksize.c') diff --git a/src/thread/pthread_attr_setstacksize.c b/src/thread/pthread_attr_setstacksize.c index 09d3fda7..9c6a8806 100644 --- a/src/thread/pthread_attr_setstacksize.c +++ b/src/thread/pthread_attr_setstacksize.c @@ -4,6 +4,6 @@ int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) { if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL; a->_a_stackaddr = 0; - a->_a_stacksize = size - DEFAULT_STACK_SIZE; + a->_a_stacksize = size; return 0; } -- cgit v1.2.1