emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning starting Emacs (Cygwin)


From: Dan Nicolaescu
Subject: Re: Warning starting Emacs (Cygwin)
Date: Sat, 02 Aug 2008 11:59:15 -0700

Angelo Graziosi <address@hidden> writes:

  > Dan Nicolaescu ha scritto:
  > > Angelo Graziosi <address@hidden> writes:
  > >
  > >   > So if you have simple suggestions I will try.
  > >
  > > Thanks.
  > >
  > > I don't know anything about the code in question, and it looks like it
  > > hasn't been touched in a while...
  > >
  > > But please look at src/vm-limit.c:check_memory_limits and see why it
  > > prints that memory full message.  It's not too many lines of code.
  > 
  > This is what I have done.

Thanks for doing this!

  > The first thing has been to verify what code is executed in
  > 'check_memory_limits'.
  > 
  > Using
  > 
  > #ifdef HAVE_GETRLIMIT
  >   ...
  >   dataa_size = rlimit.rlim_cur; /* instead of data_size */
  > 
  > #else /* not HAVE_GETRLIMIT */
  > 
  >   ...
  >   dataaa_size = (char *) cp - (char *) data_space_start;
  > 
  > #endif /* not HAVE_GETRLIMIT */
  > 
  > 
  > the compiler fails on:

In the future you might want to consider adding -save-temps to the gcc
command line, it keeps a copy of the preprocessed source in vc-limit.i,
and you can do a diff between the two preprocessed versions.  This avoids
the need to edit the file.


  > So the warning results when this code is executed:
  > 
  > #ifdef HAVE_GETRLIMIT
  >   struct rlimit rlimit;
  > 
  >   getrlimit (RLIMIT_AS, &rlimit);
  > 
  >   if (RLIM_INFINITY == rlimit.rlim_max)
  >     return;
  > 
  >   /* This is a nonsensical case, but it happens -- rms.  */
  >   if (rlimit.rlim_cur > rlimit.rlim_max)
  >     return;
  > 
  >   five_percent = rlimit.rlim_max / 20;
  >   data_size = rlimit.rlim_cur;
  > #else /* not HAVE_GETRLIMIT */
  > ...
  > #endif /* not HAVE_GETRLIMIT */
  > 
  > ...
  > if (data_size > five_percent * 19)
  >     new_warnlevel = warned_95;
  > 
  > with 'data_size > five_percent * 19' (note 5%*19 == 95%).
  > 
  > Since the code is very simple, the only thing I can think is that
  > 'getrlimit' returns wrong values in struct 'rlimit'
  > 
  > The obvious thing to do is to know the values of:
  > 
  > data_size, five_percent, rlimit.rlim_cur, rlimit.rlim_max
  > 
  > so I have tried to add

Unfortunately none of these ring a bell to me.  Yidong I assume this
code is the reason you added the HAVE_GETRLIMIT autoconf check, can you
guess what can be wrong here?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]