/usr/lib/xemacs-21.4.24/x86_64-linux-gnu/include/mem-limits.h is in xemacs21-bin 21.4.24-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | /* Includes for memory limit warnings.
Copyright (C) 1990, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of XEmacs.
XEmacs is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
XEmacs is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with XEmacs; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Synched up with: FSF 19.30. */
/* #### This ancient code really sucks.
configure should check for:
HAVE_SYS_RESOURCE_H, HAVE_ULIMIT_H, HAVE_GETRLIMIT, HAVE_ULIMIT,
and select action based on those values.
getrlimit() should be preferred to ulimit().
On Linux, ulimit() is deprecated and always returns -1. */
#ifndef INCLUDED_mem_limits_h_
#define INCLUDED_mem_limits_h_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_ULIMIT_H
#include <ulimit.h>
#endif
/* Some systems need this before <sys/resource.h>. */
#include <sys/types.h>
#ifdef _LIBC
#include <sys/resource.h>
#define BSD4_2 /* Tell code below to use getrlimit. */
/* Old Linux startup code won't define __data_start. */
extern int etext, __data_start; weak_symbol (__data_start)
#define start_of_data() (&__data_start ?: &etext)
#else /* not GNU libc */
#if defined (__osf__) && (defined (__mips) || defined (mips) || defined (__alpha))
#include <sys/time.h>
#include <sys/resource.h>
#endif
#if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__)
#define BSD4_2
#endif
#ifndef BSD4_2
#ifndef USG
#ifndef WIN32_NATIVE
#ifndef CYGWIN
#include <sys/vlimit.h>
#endif /* not CYGWIN */
#endif /* not WIN32_NATIVE */
#endif /* not USG */
#else /* if BSD4_2 */
#include <sys/time.h>
#include <sys/resource.h>
#endif /* BSD4_2 */
#ifdef emacs
/* The important properties of this type are that 1) it's a pointer, and
2) arithmetic on it should work as if the size of the object pointed
to has a size of 1. */
#ifdef __STDC__
typedef void *POINTER;
#else
typedef char *POINTER;
#endif
#ifndef CYGWIN
typedef unsigned long SIZE;
#endif
extern POINTER start_of_data (void);
#define EXCEEDS_LISP_PTR(ptr) 0
#ifdef BSD
extern int etext;
#define start_of_data() &etext
#endif
#else /* not emacs */
extern char etext;
#define start_of_data() &etext
#endif /* not emacs */
#endif /* not _LIBC */
/* start of data space; can be changed by calling malloc_init */
static POINTER data_space_start;
/* Number of bytes of writable memory we can expect to be able to get */
extern unsigned long lim_data;
#if defined (HEAP_IN_DATA) && !defined(PDUMP)
extern unsigned long static_heap_size;
extern int initialized;
static void
get_lim_data (void)
{
if (!initialized)
{
lim_data = (unsigned long) -1; /* static_heap_size; */
}
else
{
lim_data = (unsigned long) -1;
}
}
#else
#ifdef NO_LIM_DATA
static void
get_lim_data (void)
{
lim_data = (unsigned long) -1;
}
#else /* not NO_LIM_DATA */
#if defined(USG) && !defined(LINUX)
static void
get_lim_data (void)
{
lim_data = (unsigned long) -1;
/* Use the ulimit call, if we seem to have it. */
#if !defined (ULIMIT_BREAK_VALUE)
lim_data = ulimit (3, 0);
#endif
/* If that didn't work, just use the macro's value. */
#ifdef ULIMIT_BREAK_VALUE
if (lim_data == (unsigned long) -1)
lim_data = ULIMIT_BREAK_VALUE;
#endif
lim_data -= (long) data_space_start;
}
#else /* not USG */
#if defined( WIN32_NATIVE )
static void
get_lim_data (void)
{
extern unsigned long data_region_size;
lim_data = data_region_size;
}
#else
#if !defined (BSD4_2) && !defined (__osf__) && !defined(LINUX)
static void
get_lim_data (void)
{
lim_data = vlimit (LIM_DATA, -1);
}
#else /* BSD4_2 */
static void
get_lim_data (void)
{
struct rlimit XXrlimit;
getrlimit (RLIMIT_DATA, &XXrlimit);
#ifdef RLIM_INFINITY
lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
#else
lim_data = XXrlimit.rlim_cur; /* soft limit */
#endif
}
#endif /* BSD4_2 */
#endif /* not WIN32_NATIVE */
#endif /* not USG */
#endif /* not NO_LIM_DATA */
#endif /* not HEAP_IN_DATA */
#endif /* INCLUDED_mem_limits_h_ */
|