use malloc instead of sbrk
authorceriel <none@none>
Thu, 6 Aug 1987 13:04:20 +0000 (13:04 +0000)
committerceriel <none@none>
Thu, 6 Aug 1987 13:04:20 +0000 (13:04 +0000)
mach/proto/as/comm1.h
mach/proto/as/comm5.c
mach/proto/as/comm6.c
mach/proto/as/comm7.c

index 95d527d..fc4a7a9 100644 (file)
@@ -114,7 +114,7 @@ extern FILE *fftemp();
 /* some library functions used */
 extern long    atol();
 extern char    *mktemp();
-extern char    *sbrk();
+extern char    *malloc();
 extern char    *getenv();
 
 /* ========== Machine dependent C declarations ========== */
index 6a859fe..d9bf59a 100644 (file)
@@ -474,8 +474,8 @@ item_alloc(typ)
        static item_t *next;
 
        if (--nleft < 0) {
-               next = (item_t *) sbrk(MEMINCR);
-               if ((int) next == -1)
+               next = (item_t *) malloc(MEMINCR);
+               if (next == 0)
                        fatal("out of memory");
                nleft += (MEMINCR / sizeof(item_t));
        }
index bb1fe44..46b6057 100644 (file)
@@ -398,8 +398,8 @@ new_common(ip)
        static struct common_t *next;
 
        if (--nleft < 0) {
-               next = (struct common_t *) sbrk(MEMINCR);
-               if ((int) next == -1) {
+               next = (struct common_t *) malloc(MEMINCR);
+               if (next == 0) {
                        fatal("out of memory");
                }
                nleft += (MEMINCR / sizeof (struct common_t));
index f6e892d..b4951f1 100644 (file)
@@ -70,8 +70,8 @@ register char *s;
                n++;
        while (*p++);
        if ((nleft -= n) < 0) {
-               next = sbrk(MEMINCR);
-               if ((int) next == -1)
+               next = malloc(MEMINCR);
+               if (next == 0)
                        fatal("out of memory");
                nleft = (MEMINCR / sizeof(char)) - n;
                assert(nleft >= 0);