Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 622694
Collapse All | Expand All

(-)a/nptl/pthread_create.c (-3 / +16 lines)
Lines 555-564 START_THREAD_DEFN Link Here
555
  size_t pagesize_m1 = __getpagesize () - 1;
555
  size_t pagesize_m1 = __getpagesize () - 1;
556
#ifdef _STACK_GROWS_DOWN
556
#ifdef _STACK_GROWS_DOWN
557
  char *sp = CURRENT_STACK_FRAME;
557
  char *sp = CURRENT_STACK_FRAME;
558
  size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
558
  char *freeblock = (char *) pd->stackblock;
559
  size_t freesize = (sp - freeblock) & ~pagesize_m1;
559
  assert (freesize < pd->stackblock_size);
560
  assert (freesize < pd->stackblock_size);
561
# ifdef __ia64__
560
  if (freesize > PTHREAD_STACK_MIN)
562
  if (freesize > PTHREAD_STACK_MIN)
561
    __madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
563
    {
564
      /* On ia64 stack grows both ways!
565
         - normal "sp" stack (stack for local variables) grows down
566
         - register stack "bsp" grows up from the opposite end of stack block
567
568
         Thus we leave PTHREAD_STACK_MIN bytes from stack block top
569
         and leave same PTHREAD_STACK_MIN at stack block bottom.  */
570
      freeblock += PTHREAD_STACK_MIN;
571
      freesize -= PTHREAD_STACK_MIN;
572
    }
573
# endif
574
  if (freesize > PTHREAD_STACK_MIN)
575
    __madvise (freeblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
562
#else
576
#else
563
  /* Page aligned start of memory to free (higher than or equal
577
  /* Page aligned start of memory to free (higher than or equal
564
     to current sp plus the minimum stack size).  */
578
     to current sp plus the minimum stack size).  */
565
- 

Return to bug 622694