Mercurial > hg > xemacs-beta
comparison src/mem-limits.h @ 2132:34ca43a57692
[xemacs-hg @ 2004-06-16 12:01:17 by malcolmp]
IA-64 compilation and unaligned access fixes.
author | malcolmp |
---|---|
date | Wed, 16 Jun 2004 12:01:19 +0000 |
parents | 64eaceca611d |
children | 702b5727498a |
comparison
equal
deleted
inserted
replaced
2131:646a9dd3e204 | 2132:34ca43a57692 |
---|---|
56 #include <sys/time.h> | 56 #include <sys/time.h> |
57 #include <sys/resource.h> | 57 #include <sys/resource.h> |
58 #endif | 58 #endif |
59 | 59 |
60 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__) | 60 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__) |
61 #if defined(__linux__) && defined (powerpc) /*Added by Fukui*/ | |
62 #else /*Added by Fukui*/ | |
63 #define BSD4_2 | 61 #define BSD4_2 |
64 #endif /*Added by Fukui*/ | |
65 #endif | 62 #endif |
66 | 63 |
67 #ifndef BSD4_2 | 64 #ifndef BSD4_2 |
68 #ifndef USG | 65 #ifndef USG |
69 #ifndef WIN32_NATIVE | 66 #ifndef WIN32_NATIVE |
70 #ifndef CYGWIN | 67 #ifndef CYGWIN |
71 #if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/ | |
72 #else /*Added Kaoru Fukui*/ | |
73 #include <sys/vlimit.h> | 68 #include <sys/vlimit.h> |
74 #endif /*Added by Fukui*/ | |
75 #endif /* not CYGWIN */ | 69 #endif /* not CYGWIN */ |
76 #endif /* not WIN32_NATIVE */ | 70 #endif /* not WIN32_NATIVE */ |
77 #endif /* not USG */ | 71 #endif /* not USG */ |
78 #else /* if BSD4_2 */ | 72 #else /* if BSD4_2 */ |
79 #include <sys/time.h> | 73 #include <sys/time.h> |
106 | 100 |
107 /* start of data space; can be changed by calling malloc_init */ | 101 /* start of data space; can be changed by calling malloc_init */ |
108 static POINTER data_space_start; | 102 static POINTER data_space_start; |
109 | 103 |
110 /* Number of bytes of writable memory we can expect to be able to get */ | 104 /* Number of bytes of writable memory we can expect to be able to get */ |
111 extern unsigned int lim_data; | 105 extern unsigned long lim_data; |
112 | 106 |
113 #if defined (HEAP_IN_DATA) && !defined(PDUMP) | 107 #if defined (HEAP_IN_DATA) && !defined(PDUMP) |
114 extern unsigned long static_heap_size; | 108 extern unsigned long static_heap_size; |
115 extern MODULE_API int initialized; | 109 extern MODULE_API int initialized; |
116 static void | 110 static void |
117 get_lim_data (void) | 111 get_lim_data (void) |
118 { | 112 { |
119 if (!initialized) | 113 if (!initialized) |
120 { | 114 { |
121 lim_data = (unsigned int) -1; /* static_heap_size; */ | 115 lim_data = (unsigned long) -1; /* static_heap_size; */ |
122 } | 116 } |
123 else | 117 else |
124 { | 118 { |
125 lim_data = (unsigned int) -1; | 119 lim_data = (unsigned long) -1; |
126 } | 120 } |
127 } | 121 } |
128 #else | 122 #else |
129 #ifdef NO_LIM_DATA | 123 #ifdef NO_LIM_DATA |
130 static void | 124 static void |
131 get_lim_data (void) | 125 get_lim_data (void) |
132 { | 126 { |
133 lim_data = (unsigned int) -1; | 127 lim_data = (unsigned long) -1; |
134 } | 128 } |
135 #else /* not NO_LIM_DATA */ | 129 #else /* not NO_LIM_DATA */ |
136 | 130 |
137 #ifdef USG | 131 #if defined(USG) && !defined(LINUX) |
138 | 132 |
139 static void | 133 static void |
140 get_lim_data (void) | 134 get_lim_data (void) |
141 { | 135 { |
142 lim_data = (unsigned int) -1; | 136 lim_data = (unsigned long) -1; |
143 | 137 |
144 /* Use the ulimit call, if we seem to have it. */ | 138 /* Use the ulimit call, if we seem to have it. */ |
145 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX) | 139 #if !defined (ULIMIT_BREAK_VALUE) |
146 lim_data = ulimit (3, 0); | 140 lim_data = ulimit (3, 0); |
147 #endif | 141 #endif |
148 | 142 |
149 /* If that didn't work, just use the macro's value. */ | 143 /* If that didn't work, just use the macro's value. */ |
150 #ifdef ULIMIT_BREAK_VALUE | 144 #ifdef ULIMIT_BREAK_VALUE |
151 if (lim_data == (unsigned int) -1) | 145 if (lim_data == (unsigned long) -1) |
152 lim_data = ULIMIT_BREAK_VALUE; | 146 lim_data = ULIMIT_BREAK_VALUE; |
153 #endif | 147 #endif |
154 | 148 |
155 lim_data -= (long) data_space_start; | 149 lim_data -= (long) data_space_start; |
156 } | 150 } |
164 extern unsigned long data_region_size; | 158 extern unsigned long data_region_size; |
165 lim_data = data_region_size; | 159 lim_data = data_region_size; |
166 } | 160 } |
167 | 161 |
168 #else | 162 #else |
169 #if !defined (BSD4_2) && !defined (__osf__) | 163 #if !defined (BSD4_2) && !defined (__osf__) && !defined(LINUX) |
170 | 164 |
171 static void | 165 static void |
172 get_lim_data (void) | 166 get_lim_data (void) |
173 { | 167 { |
174 lim_data = vlimit (LIM_DATA, -1); | 168 lim_data = vlimit (LIM_DATA, -1); |