comparison src/mem-limits.h @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children e22b0213b713
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
36 36
37 #ifdef HAVE_ULIMIT_H 37 #ifdef HAVE_ULIMIT_H
38 #include <ulimit.h> 38 #include <ulimit.h>
39 #endif 39 #endif
40 40
41 #ifdef MSDOS
42 #include <dpmi.h>
43 #endif
44
45 /* Some systems need this before <sys/resource.h>. */ 41 /* Some systems need this before <sys/resource.h>. */
46 #include <sys/types.h> 42 #include <sys/types.h>
47 43
48 #ifdef _LIBC 44 #ifdef _LIBC
49 45
68 #endif /*Added by Fukui*/ 64 #endif /*Added by Fukui*/
69 #endif 65 #endif
70 66
71 #ifndef BSD4_2 67 #ifndef BSD4_2
72 #ifndef USG 68 #ifndef USG
73 #ifndef MSDOS 69 #ifndef WIN32_NATIVE
74 #ifndef WINDOWSNT 70 #ifndef CYGWIN
75 #ifndef __CYGWIN32__
76 #if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/ 71 #if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/
77 #else /*Added Kaoru Fukui*/ 72 #else /*Added Kaoru Fukui*/
78 #include <sys/vlimit.h> 73 #include <sys/vlimit.h>
79 #endif /*Added by Fukui*/ 74 #endif /*Added by Fukui*/
80 #endif /* not __CYGWIN32__ */ 75 #endif /* not CYGWIN */
81 #endif /* not WINDOWSNT */ 76 #endif /* not WIN32_NATIVE */
82 #endif /* not MSDOS */
83 #endif /* not USG */ 77 #endif /* not USG */
84 #else /* if BSD4_2 */ 78 #else /* if BSD4_2 */
85 #include <sys/time.h> 79 #include <sys/time.h>
86 #include <sys/resource.h> 80 #include <sys/resource.h>
87 #endif /* BSD4_2 */ 81 #endif /* BSD4_2 */
94 typedef void *POINTER; 88 typedef void *POINTER;
95 #else 89 #else
96 typedef char *POINTER; 90 typedef char *POINTER;
97 #endif 91 #endif
98 92
99 #ifndef __CYGWIN32__ 93 #ifndef CYGWIN
100 typedef unsigned long SIZE; 94 typedef unsigned long SIZE;
101 #endif 95 #endif
102 96
103 extern POINTER start_of_data (void); 97 extern POINTER start_of_data (void);
104 #define EXCEEDS_LISP_PTR(ptr) 0 98 #define EXCEEDS_LISP_PTR(ptr) 0
105 99
106 #ifdef BSD 100 #ifdef BSD
107 #ifndef DATA_SEG_BITS
108 extern int etext; 101 extern int etext;
109 #define start_of_data() &etext 102 #define start_of_data() &etext
110 #endif
111 #endif 103 #endif
112 104
113 #else /* not emacs */ 105 #else /* not emacs */
114 extern char etext; 106 extern char etext;
115 #define start_of_data() &etext 107 #define start_of_data() &etext
123 static POINTER data_space_start; 115 static POINTER data_space_start;
124 116
125 /* Number of bytes of writable memory we can expect to be able to get */ 117 /* Number of bytes of writable memory we can expect to be able to get */
126 extern unsigned int lim_data; 118 extern unsigned int lim_data;
127 119
128 #ifdef HEAP_IN_DATA 120 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
129 extern unsigned long static_heap_size; 121 extern unsigned long static_heap_size;
130 extern int initialized; 122 extern int initialized;
131 static void 123 static void
132 get_lim_data (void) 124 get_lim_data (void)
133 { 125 {
169 161
170 lim_data -= (long) data_space_start; 162 lim_data -= (long) data_space_start;
171 } 163 }
172 164
173 #else /* not USG */ 165 #else /* not USG */
174 #if defined( WINDOWSNT ) 166 #if defined( WIN32_NATIVE )
175 167
176 static void 168 static void
177 get_lim_data (void) 169 get_lim_data (void)
178 { 170 {
179 extern unsigned long data_region_size; 171 extern unsigned long data_region_size;
181 } 173 }
182 174
183 #else 175 #else
184 #if !defined (BSD4_2) && !defined (__osf__) 176 #if !defined (BSD4_2) && !defined (__osf__)
185 177
186 #ifdef MSDOS
187 void
188 get_lim_data (void)
189 {
190 _go32_dpmi_meminfo info;
191
192 _go32_dpmi_get_free_memory_information (&info);
193 lim_data = info.available_memory;
194 }
195 #else /* not MSDOS */
196 static void 178 static void
197 get_lim_data (void) 179 get_lim_data (void)
198 { 180 {
199 lim_data = vlimit (LIM_DATA, -1); 181 lim_data = vlimit (LIM_DATA, -1);
200 } 182 }
201 #endif /* not MSDOS */
202 183
203 #else /* BSD4_2 */ 184 #else /* BSD4_2 */
204 185
205 static void 186 static void
206 get_lim_data (void) 187 get_lim_data (void)
213 #else 194 #else
214 lim_data = XXrlimit.rlim_cur; /* soft limit */ 195 lim_data = XXrlimit.rlim_cur; /* soft limit */
215 #endif 196 #endif
216 } 197 }
217 #endif /* BSD4_2 */ 198 #endif /* BSD4_2 */
218 #endif /* not WINDOWSNT */ 199 #endif /* not WIN32_NATIVE */
219 #endif /* not USG */ 200 #endif /* not USG */
220 #endif /* not NO_LIM_DATA */ 201 #endif /* not NO_LIM_DATA */
221 #endif /* not HEAP_IN_DATA */ 202 #endif /* not HEAP_IN_DATA */
222 203
223 #endif /* INCLUDED_mem_limits_h_ */ 204 #endif /* INCLUDED_mem_limits_h_ */