]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The calculation used to round the size of a new thread's stack to a
authorTom Hughes <tom@compton.nu>
Tue, 16 Nov 2004 19:44:06 +0000 (19:44 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 16 Nov 2004 19:44:06 +0000 (19:44 +0000)
multiple of the page size had an off by one error. Fixed it to use
the PGROUNDUP macro instead of trying to do the calculation itself
and then get it wrong.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_2_2_0_BRANCH@3032

coregrind/vg_scheduler.c
none/tests/.cvsignore
none/tests/Makefile.am

index 12429cee51421cb33f13d7a3daeaea91ee609c82..733f4845fbe064998739f3454c977ffa4180ed85 100644 (file)
@@ -1953,8 +1953,7 @@ void do__apply_in_new_thread ( ThreadId parent_tid,
 
    /* Consider allocating the child a stack, if the one it already has
       is inadequate. */
-   new_stk_szb = si->size + VG_AR_CLIENT_STACKBASE_REDZONE_SZB + si->guardsize;
-   new_stk_szb = (new_stk_szb + VKI_BYTES_PER_PAGE - 1) & ~VKI_BYTES_PER_PAGE;
+   new_stk_szb = PGROUNDUP(si->size + VG_AR_CLIENT_STACKBASE_REDZONE_SZB + si->guardsize);
     
    VG_(threads)[tid].stack_guard_size = si->guardsize;
 
index ecc0a99227856881378cb83a4560bca349667672..5d366a0fa985a2dad0f84e2201366828164141ee 100644 (file)
@@ -39,6 +39,7 @@ munmap_exe
 mremap
 pluto
 pth_blockedsig
+pth_stackalign
 rcl_assert
 rcrl
 readline1
index 6ddfca3c88273e0cd2d246092747fab6a6e93e25..11b393bd9a1c2f7758180818b6da6e34118a89a1 100644 (file)
@@ -46,6 +46,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        munmap_exe.stderr.exp munmap_exe.vgtest \
        pth_blockedsig.stderr.exp \
        pth_blockedsig.stdout.exp pth_blockedsig.vgtest \
+       pth_stackalign.stderr.exp \
+       pth_stackalign.stdout.exp pth_stackalign.vgtest \
        pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \
        rcl_assert.stderr.exp rcl_assert.vgtest \
        rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
@@ -74,8 +76,8 @@ check_PROGRAMS = \
        fpu_lazy_eflags fucomip $(INSN_TESTS) \
        int munmap_exe map_unmap mq mremap rcl_assert rcrl readline1 \
        resolv rlimit_nofile seg_override sem semlimit sha1_test \
-       shortpush shorts smc1 susphello pth_blockedsig pushpopseg \
-       syscall-restart1 syscall-restart2 system \
+       shortpush shorts smc1 susphello pth_blockedsig pth_stackalign \
+       pushpopseg syscall-restart1 syscall-restart2 system \
        coolo_sigaction gxx304 yield
 
 AM_CFLAGS   = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include
@@ -155,6 +157,8 @@ yield_LDADD         = -lpthread
 # pthread C ones
 pth_blockedsig_SOURCES = pth_blockedsig.c
 pth_blockedsig_LDADD   = -lpthread
+pth_stackalign_SOURCES = pth_stackalign.c
+pth_stackalign_LDADD   = -lpthread
 
 # generic C++ ones
 coolo_sigaction_SOURCES        = coolo_sigaction.cpp