You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#ifdef emacs
#include <config.h>
static void
check_memory_limits ()
{
+#ifdef REL_ALLOC
+ extern POINTER (*real_morecore) ();
+#endif
extern POINTER (*__morecore) ();
+
register POINTER cp;
unsigned long five_percent;
unsigned long data_size;
five_percent = lim_data / 20;
/* Find current end of memory and issue warning if getting near max */
+#ifdef REL_ALLOC
+ if (real_morecore)
+ cp = (char *) (*real_morecore) (0);
+ else
+#endif
cp = (char *) (*__morecore) (0);
data_size = (char *) cp - (char *) data_space_start;
if (warn_function)
switch (warnlevel)
{
- case 0:
+ case 0:
if (data_size > five_percent * 15)
{
warnlevel++;
}
break;
- case 1:
+ case 1:
if (data_size > five_percent * 17)
{
warnlevel++;
}
break;
- case 2:
+ case 2:
if (data_size > five_percent * 19)
{
warnlevel++;
warn_function = warnfun;
__after_morecore_hook = check_memory_limits;
+
+#ifdef WINDOWSNT
+ /* Force data limit to be recalculated on each run. */
+ lim_data = 0;
+#endif
}