comparison src/mem-limits.h @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 677f6a0ee643
children 6330739388db
comparison
equal deleted inserted replaced
271:c7b7086b0a39 272:c5d627a313b1
59 #if defined (__osf__) && (defined (__mips) || defined (mips) || defined (__alpha)) 59 #if defined (__osf__) && (defined (__mips) || defined (mips) || defined (__alpha))
60 #include <sys/time.h> 60 #include <sys/time.h>
61 #include <sys/resource.h> 61 #include <sys/resource.h>
62 #endif 62 #endif
63 63
64 #if defined(__bsdi__) || defined(__NetBSD__) 64 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__)
65 #define BSD4_2 65 #define BSD4_2
66 #endif 66 #endif
67 67
68 #ifndef BSD4_2 68 #ifndef BSD4_2
69 #ifndef USG 69 #ifndef USG
92 92
93 #ifndef __CYGWIN32__ 93 #ifndef __CYGWIN32__
94 typedef unsigned long SIZE; 94 typedef unsigned long SIZE;
95 #endif 95 #endif
96 96
97 #ifdef NULL
98 #undef NULL
99 #endif
100 #define NULL ((POINTER) 0)
101
102 extern POINTER start_of_data (); 97 extern POINTER start_of_data ();
103 #ifdef DATA_SEG_BITS 98 #ifdef DATA_SEG_BITS
104 #define EXCEEDS_LISP_PTR(ptr) \ 99 #define EXCEEDS_LISP_PTR(ptr) \
105 (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS) 100 (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS)
106 #else 101 #else
112 extern int etext; 107 extern int etext;
113 #define start_of_data() &etext 108 #define start_of_data() &etext
114 #endif 109 #endif
115 #endif 110 #endif
116 111
117 #else /* not emacs */ 112 #else /* not emacs */
118 extern char etext; 113 extern char etext;
119 #define start_of_data() &etext 114 #define start_of_data() &etext
120 #endif /* not emacs */ 115 #endif /* not emacs */
121 116
122 #endif /* not _LIBC */ 117 #endif /* not _LIBC */
123 118
124 119
125 120
126 /* start of data space; can be changed by calling malloc_init */ 121 /* start of data space; can be changed by calling malloc_init */
127 static POINTER data_space_start; 122 static POINTER data_space_start;
128 123
129 /* Number of bytes of writable memory we can expect to be able to get */ 124 /* Number of bytes of writable memory we can expect to be able to get */
135 static void 130 static void
136 get_lim_data (void) 131 get_lim_data (void)
137 { 132 {
138 if (!initialized) 133 if (!initialized)
139 { 134 {
140 lim_data = -1; /* static_heap_size; */ 135 lim_data = (unsigned int) -1; /* static_heap_size; */
141 } 136 }
142 else 137 else
143 { 138 {
144 lim_data = -1; 139 lim_data = (unsigned int) -1;
145 } 140 }
146 } 141 }
147 #else 142 #else
148 #ifdef NO_LIM_DATA 143 #ifdef NO_LIM_DATA
149 static void 144 static void
150 get_lim_data (void) 145 get_lim_data (void)
151 { 146 {
152 lim_data = -1; 147 lim_data = (unsigned int) -1;
153 } 148 }
154 #else /* not NO_LIM_DATA */ 149 #else /* not NO_LIM_DATA */
155 150
156 #ifdef USG 151 #ifdef USG
157 152
158 static void 153 static void
159 get_lim_data (void) 154 get_lim_data (void)
160 { 155 {
161 lim_data = -1; 156 lim_data = (unsigned int) -1;
162 157
163 /* Use the ulimit call, if we seem to have it. */ 158 /* Use the ulimit call, if we seem to have it. */
164 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX) 159 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
165 lim_data = ulimit (3, 0); 160 lim_data = ulimit (3, 0);
166 #endif 161 #endif
167 162
168 /* If that didn't work, just use the macro's value. */ 163 /* If that didn't work, just use the macro's value. */
169 #ifdef ULIMIT_BREAK_VALUE 164 #ifdef ULIMIT_BREAK_VALUE
170 if (lim_data == -1) 165 if (lim_data == (unsigned int) -1)
171 lim_data = ULIMIT_BREAK_VALUE; 166 lim_data = ULIMIT_BREAK_VALUE;
172 #endif 167 #endif
173 168
174 lim_data -= (long) data_space_start; 169 lim_data -= (long) data_space_start;
175 } 170 }