Mercurial > emacs
comparison src/mem-limits.h @ 90365:a802c5505156
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-43
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 148-156)
- Update from CVS
- Merge from gnus--rel--5.10
- Remove nick-abbrevs stuff from rcirc.el
- rcirc.el update from Ryan Yeske
* gnus--rel--5.10 (patch 57)
- Copy/update icons from Gnus trunk
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 13 Mar 2006 12:19:58 +0000 |
parents | c5406394f567 858b77cfcdf5 |
children | 95d0cdf160ea |
comparison
equal
deleted
inserted
replaced
90364:494bf720eaf0 | 90365:a802c5505156 |
---|---|
110 #endif /* not emacs */ | 110 #endif /* not emacs */ |
111 | 111 |
112 #endif /* not _LIBC */ | 112 #endif /* not _LIBC */ |
113 | 113 |
114 | 114 |
115 /* start of data space; can be changed by calling malloc_init */ | |
116 static POINTER data_space_start; | |
117 | |
118 /* Number of bytes of writable memory we can expect to be able to get */ | |
119 static unsigned long lim_data; | |
120 | |
121 #ifdef NO_LIM_DATA | |
122 static void | |
123 get_lim_data () | |
124 { | |
125 lim_data = -1; | |
126 } | |
127 #else /* not NO_LIM_DATA */ | |
128 | |
129 #ifdef USG | |
130 | |
131 static void | |
132 get_lim_data () | |
133 { | |
134 extern long ulimit (); | |
135 | |
136 lim_data = -1; | |
137 | |
138 /* Use the ulimit call, if we seem to have it. */ | |
139 #if !defined (ULIMIT_BREAK_VALUE) || defined (GNU_LINUX) | |
140 lim_data = ulimit (3, 0); | |
141 #endif | |
142 | |
143 /* If that didn't work, just use the macro's value. */ | |
144 #ifdef ULIMIT_BREAK_VALUE | |
145 if (lim_data == -1) | |
146 lim_data = ULIMIT_BREAK_VALUE; | |
147 #endif | |
148 | |
149 lim_data -= (long) data_space_start; | |
150 } | |
151 | |
152 #else /* not USG */ | |
153 #ifdef WINDOWSNT | |
154 | |
155 static void | |
156 get_lim_data () | |
157 { | |
158 extern unsigned long reserved_heap_size; | |
159 lim_data = reserved_heap_size; | |
160 } | |
161 | |
162 #else | |
163 #if !defined (BSD4_2) && !defined (__osf__) | |
164 | |
165 #ifdef MSDOS | |
166 void | |
167 get_lim_data () | |
168 { | |
169 _go32_dpmi_meminfo info; | |
170 | |
171 _go32_dpmi_get_free_memory_information (&info); | |
172 lim_data = info.available_memory; | |
173 } | |
174 #else /* not MSDOS */ | |
175 static void | |
176 get_lim_data () | |
177 { | |
178 lim_data = vlimit (LIM_DATA, -1); | |
179 } | |
180 #endif /* not MSDOS */ | |
181 | |
182 #else /* BSD4_2 */ | |
183 | |
184 static void | |
185 get_lim_data () | |
186 { | |
187 struct rlimit XXrlimit; | |
188 | |
189 getrlimit (RLIMIT_DATA, &XXrlimit); | |
190 #ifdef RLIM_INFINITY | |
191 lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */ | |
192 #else | |
193 lim_data = XXrlimit.rlim_cur; /* soft limit */ | |
194 #endif | |
195 } | |
196 #endif /* BSD4_2 */ | |
197 #endif /* not WINDOWSNT */ | |
198 #endif /* not USG */ | |
199 #endif /* not NO_LIM_DATA */ | |
200 | |
201 /* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5 | 115 /* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5 |
202 (do not change this comment) */ | 116 (do not change this comment) */ |