Annotation of 43BSDTahoe/usr.lib/libpc/NEW.c, revision 1.1

1.1     ! root        1: /* Copyright (c) 1979 Regents of the University of California */
        !             2: 
        !             3: static char sccsid[] = "@(#)NEW.c 1.3 6/10/81";
        !             4: 
        !             5: #include "h00vars.h"
        !             6: 
        !             7: NEW(var, size)
        !             8:        char    **var;  /* pointer to item being deallocated */
        !             9:        long    size;   /* sizeof struct pointed to by var */
        !            10: {
        !            11:        extern  char *malloc();
        !            12:        char    *memblk;
        !            13: 
        !            14:        memblk = malloc((int)size);
        !            15:        if (memblk == 0) {
        !            16:                ERROR("Ran out of memory\n", 0);
        !            17:                return;
        !            18:        }
        !            19:        *var = memblk;
        !            20:        if (memblk < _minptr)
        !            21:                _minptr = memblk;
        !            22:        if (memblk + size > _maxptr)
        !            23:                _maxptr = memblk + size;
        !            24: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.