From 47f810920afff067666bd6496a3c92e92e2d65a8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 2 Feb 2001 04:32:02 +0000 Subject: [PATCH] * cygheap.cc (creturn): Correctly calculate cygheap_max. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/cygheap.cc | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6708d7e44..98bfb224d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 1 23:08:29 2001 Christopher Faylor + + * cygheap.cc (creturn): Correctly calculate cygheap_max. + Wed Jan 31 10:04:58 2001 Christopher Faylor * shared.cc (shared_info::initialize): Reduce size of heap. diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 49a819a65..585ca8aa8 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; }