comparison src/malloc.c @ 169:15872534500d r20-3b11

Import from CVS: tag r20-3b11
author cvs
date Mon, 13 Aug 2007 09:46:53 +0200
parents ac2d302a0011
children 41ff10fd062f
comparison
equal deleted inserted replaced
168:9851d5c6556e 169:15872534500d
169 #endif /* not emacs */ 169 #endif /* not emacs */
170 170
171 /* Define getpagesize () if the system does not. */ 171 /* Define getpagesize () if the system does not. */
172 #include "getpagesize.h" 172 #include "getpagesize.h"
173 173
174 #ifdef HAVE_ULIMIT_H
175 #include <ulimit.h>
176 #endif
177
174 #ifndef BSD4_2 178 #ifndef BSD4_2
175 #ifndef USG 179 #ifndef USG
176 #include <sys/vlimit.h> /* warn the user when near the end */ 180 #include <sys/vlimit.h> /* warn the user when near the end */
177 #endif /* not USG */ 181 #endif /* not USG */
178 #else /* if BSD4_2 */ 182 #else /* if BSD4_2 */
299 /* nonzero once initial bunch of free blocks made */ 303 /* nonzero once initial bunch of free blocks made */
300 static int gotpool; 304 static int gotpool;
301 305
302 char *_malloc_base; 306 char *_malloc_base;
303 307
304 static void getpool (); 308 static void getpool (void);
305 309
306 /* Cause reinitialization based on job parameters; 310 /* Cause reinitialization based on job parameters;
307 also declare where the end of pure storage is. */ 311 also declare where the end of pure storage is. */
308 void 312 void
309 malloc_init (start, warnfun) 313 malloc_init (start, warnfun)
445 #endif 449 #endif
446 #endif 450 #endif
447 } 451 }
448 452
449 static void 453 static void
450 getpool () 454 getpool (void)
451 { 455 {
452 int nu; 456 int nu;
453 char *cp = sbrk (0); 457 char *cp = sbrk (0);
454 458
455 if ((int) cp & 0x3ff) /* land on 1K boundaries */ 459 if ((int) cp & 0x3ff) /* land on 1K boundaries */
796 #ifdef USG 800 #ifdef USG
797 801
798 static void 802 static void
799 get_lim_data () 803 get_lim_data ()
800 { 804 {
801 extern long ulimit ();
802
803 #ifdef ULIMIT_BREAK_VALUE 805 #ifdef ULIMIT_BREAK_VALUE
804 lim_data = ULIMIT_BREAK_VALUE; 806 lim_data = ULIMIT_BREAK_VALUE;
805 #else 807 #else
806 lim_data = ulimit (3, 0); 808 lim_data = ulimit (3, 0);
807 #endif 809 #endif