delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/20/22:52:32

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 20 Nov 2000 19:34:49 -0800
From: "Zack Weinberg" <zackw AT Stanford DOT EDU>
To: Richard Henderson <rth AT redhat DOT com>
Cc: Kelley Cook <Kelley DOT Cook AT home DOT com>,
Cygwin mailing list <Cygwin AT sources DOT redhat DOT com>,
GCC Bugs <gcc-bugs AT gcc DOT gnu DOT org>, GCC Patches <gcc-patches AT gcc DOT gnu DOT org>
Subject: Re: Reason for cygwin GCC 2.97 non-bootstrap found
Message-ID: <20001120193449.Y17712@wolery.stanford.edu>
References: <200011202245 DOT eAKMjjN27680 AT plmlir3 DOT mail DOT eds DOT com> <20001120154222 DOT O17712 AT wolery DOT stanford DOT edu> <20001120192414 DOT D17317 AT redhat DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20001120192414.D17317@redhat.com>; from rth@redhat.com on Mon, Nov 20, 2000 at 07:24:14PM -0800

On Mon, Nov 20, 2000 at 07:24:14PM -0800, Richard Henderson wrote:
> On Mon, Nov 20, 2000 at 03:42:23PM -0800, Zack Weinberg wrote:
> > +#if use_malloc
> > +  return (char *) malloc (size);
> > +#endif
> [...]
> > +  return res + offset;
> 
> I refuse to believe that there exists any magic size/roundup/offset
> combination that *always* returns a full page of aligned memory.

Laurnyas' version of this patch went through extreme contortions to
figure out where in a N-page chunk of memory an N-1-page chunk of
aligned memory was located, assuming that this would be different each
time.  I thought just the opposite you do, so I took it out - it would
be relatively easy to put it back.

> The only semi-decent solution I can think of is to get N*pagesize+C
> bytes from malloc, which can then be delivered as N' aligned data pages,
> plus a control block of size C to determine when the entire block may
> be freed.  N' will normally be N-1, but could accidentally be N.

In fact I plan to do this after I figure out just where the labor
split between libiberty and ggc-page.c should be.  I wanted to get the
basic patch out there so it could be tested by people without mmap, or
malloc that page-aligns all page-sized memory requests.

> Moreover, I think the ggc-page mmap optimizations are useful enough
> that I do not want to defer everything to an xvalloc or the like.

They should come back as a side effect of doing the N*pagesize+C thing
you suggest.

zw

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019