Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin@cygwin.com
From: Joe Buehler <jbuehler@hekimian.com>
Subject: Re: trying to compile emacs under cygwin
Date: Fri, 28 Mar 2003 09:23:06 -0500
Organization: Spirent Communications, Inc.
Lines: 40
Message-ID: <3E845ACA.7070302@hekimian.com>
References: <3E81DEFC.8080603@hekimian.com> <16003.31199.26941.271222@gargle.gargle.HOWL>
Reply-To: jbuehler@hekimian.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@main.gmane.org
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en
In-Reply-To: <16003.31199.26941.271222@gargle.gargle.HOWL>
X-Enigmail-Version: 0.73.1.0
X-Enigmail-Supports: pgp-inline, pgp-mime

Robert Mecklenburg wrote:

> Static heap usage: 2129280 of 10648960, slop is 65536 -- 8320k wasted -- reset to 2194816k
> emacs: SHEAP_ADJUSTMENT needs to be modified to reduce memory waste!

You increased the heap size, but it's outside the fuzz range -- you
are over it by about 8 MB.  Emacs would run, but the problem is that
the binary would be a lot larger than it needs to be.  Under Cygwin,
this is an issue because of the way that fork() works.

So what you have to do is increase SHEAP_ADJUSTMENT by enough that
you end up in the comparison fuzz range.

> actually writes sheap.c, so I edit the script to change the -620000
> to:
> 
> +#ifdef HAVE_X_WINDOWS
> +#define SHEAP_ADJUSTMENT 2194816 /* XEmacs does this dynamically */
> +#else
> +#define SHEAP_ADJUSTMENT 2194816 /* XEmacs does this dynamically */
> +#endif

That's the correct thing to do.  Edit the build script -- it patches
the original emacs source for Cygwin.

What you want to do is look at the message you get after you compile:

Static heap usage: 2129280 of 10648960, slop is 65536 -- 8320k wasted -- reset to 2194816k

And figure out what to set SHEAP_ADJUSTMENT to based on how the first two numbers
compare.  The message says that you used 2129280 bytes out of 10648960 available,
so decrease SHEAP_ADJUSTMENT by (10648960 - 2129280).  SHEAP_ADJUSTMENT will be some
negative number because the base heap size is 8 MB, and emacs doesn't need anywhere
near that.

If it helps any, this piece of code hurts my head also -- I have no idea why it
is set up to be so complicated.  But it works!
-- 
Joe Buehler



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

