aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/cygheap.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-02-02 04:32:02 +0000
committerChristopher Faylor <me@cgf.cx>2001-02-02 04:32:02 +0000
commit47f810920afff067666bd6496a3c92e92e2d65a8 (patch)
tree98328ee09b593859c980d4d394ab5fa61b240a6f /winsup/cygwin/cygheap.cc
parentb5139f598bf64bdb3212375a6ee6907dfbeacea0 (diff)
downloadnewlib-47f810920afff067666bd6496a3c92e92e2d65a8.zip
newlib-47f810920afff067666bd6496a3c92e92e2d65a8.tar.gz
newlib-47f810920afff067666bd6496a3c92e92e2d65a8.tar.bz2
* cygheap.cc (creturn): Correctly calculate cygheap_max.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 49a819a..585ca8a 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -202,8 +202,9 @@ creturn (cygheap_types x, cygheap_entry * c, int len)
return NULL;
}
c->type = x;
- if (cygheap_max < ((char *) c + len))
- cygheap_max = (char *) c + len;
+ char *cend = ((char *) c + sizeof (*c) + len);
+ if (cygheap_max < cend)
+ cygheap_max = cend;
MALLOC_CHECK;
return (void *) c->data;
}