limit of the brk segment.
Because VG_(brk_limit) is the first address beyond the end of the
memory available to the caller of brk() we need to allow it to grow
up to and including the address one page below the end of the space
valgrind has reserved.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5974
return newbrk;
}
- if (newbrk >= rseg->end+1 - VKI_PAGE_SIZE) {
+ if (newbrk > rseg->end+1 - VKI_PAGE_SIZE) {
/* request is too large -- the resvn would fall below 1 page,
which isn't allowed. */
goto bad;
}
newbrkP = VG_PGROUNDUP(newbrk);
- vg_assert(newbrkP > rseg->start && newbrkP < rseg->end+1 - VKI_PAGE_SIZE);
+ vg_assert(newbrkP > rseg->start && newbrkP <= rseg->end+1 - VKI_PAGE_SIZE);
delta = newbrkP - rseg->start;
vg_assert(delta > 0);
vg_assert(VG_IS_PAGE_ALIGNED(delta));