diff options
author | alfred <alfred@FreeBSD.org> | 2002-05-15 05:37:48 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-05-15 05:37:48 +0000 |
commit | 71694f1a9ca29f36d65da690c5ab3c397456a302 (patch) | |
tree | ffa869d7fbde31c3c093b9414b451acfbf2235e9 /lib/libpthread/thread/thr_stack.c | |
parent | 00266d9f514548f059b442a5cbb5701d749c734a (diff) | |
download | FreeBSD-src-71694f1a9ca29f36d65da690c5ab3c397456a302.zip FreeBSD-src-71694f1a9ca29f36d65da690c5ab3c397456a302.tar.gz |
Undo namespace pollution by prefixing the globals pthread_guard_default and
pthread_page_size.
Fix a bunch line wrapping.
Pointed out by: deischen
Diffstat (limited to 'lib/libpthread/thread/thr_stack.c')
-rw-r--r-- | lib/libpthread/thread/thr_stack.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/libpthread/thread/thr_stack.c b/lib/libpthread/thread/thr_stack.c index 1913b09..80c9d53 100644 --- a/lib/libpthread/thread/thr_stack.c +++ b/lib/libpthread/thread/thr_stack.c @@ -122,13 +122,15 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize) size_t stack_size; /* - * Round up stack size to nearest multiple of pthread_page_size, so that mmap() - * will work. If the stack size is not an even multiple, we end up - * initializing things such that there is unused space above the - * beginning of the stack, so the stack sits snugly against its guard. + * Round up stack size to nearest multiple of _pthread_page_size, + * so that mmap() * will work. If the stack size is not an even + * multiple, we end up initializing things such that there is unused + * space above the beginning of the stack, so the stack sits snugly + * against its guard. */ - if (stacksize % pthread_page_size != 0) - stack_size = ((stacksize / pthread_page_size) + 1) * pthread_page_size; + if (stacksize % _pthread_page_size != 0) + stack_size = ((stacksize / _pthread_page_size) + 1) * + _pthread_page_size; else stack_size = stacksize; @@ -137,7 +139,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize) * from the default-size stack cache: */ if (stack_size == PTHREAD_STACK_DEFAULT && - guardsize == pthread_guard_default) { + guardsize == _pthread_guard_default) { /* * Use the garbage collector mutex for synchronization of the * spare stack list. @@ -187,7 +189,7 @@ _thread_stack_alloc(size_t stacksize, size_t guardsize) if (last_stack == NULL) last_stack = _usrstack - PTHREAD_STACK_INITIAL - - pthread_guard_default; + _pthread_guard_default; /* Allocate a new stack. */ stack = last_stack - stack_size; @@ -217,17 +219,18 @@ _thread_stack_free(void *stack, size_t stacksize, size_t guardsize) struct stack *spare_stack; spare_stack = (stack + stacksize - sizeof(struct stack)); - /* Round stacksize up to nearest multiple of pthread_page_size. */ - if (stacksize % pthread_page_size != 0) { - spare_stack->stacksize = ((stacksize / pthread_page_size) + 1) * - pthread_page_size; + /* Round stacksize up to nearest multiple of _pthread_page_size. */ + if (stacksize % _pthread_page_size != 0) { + spare_stack->stacksize = + ((stacksize / _pthread_page_size) + 1) * + _pthread_page_size; } else spare_stack->stacksize = stacksize; spare_stack->guardsize = guardsize; spare_stack->stackaddr = stack; if (spare_stack->stacksize == PTHREAD_STACK_DEFAULT && - spare_stack->guardsize == pthread_guard_default) { + spare_stack->guardsize == _pthread_guard_default) { /* Default stack/guard size. */ LIST_INSERT_HEAD(&_dstackq, spare_stack, qe); } else { |