Annotation of 42BSD/usr.lib/libpc/DISPOSE.c, revision 1.1

1.1     ! root        1: /* Copyright (c) 1979 Regents of the University of California */
        !             2: 
        !             3: static char sccsid[] = "@(#)DISPOSE.c 1.3 6/10/81";
        !             4: 
        !             5: #include       "h00vars.h"
        !             6: 
        !             7: DISPOSE(var, siz)
        !             8:        register char   **var;  /* pointer to pointer being deallocated */
        !             9:        long            siz;    /* sizeof(bletch) */
        !            10: {
        !            11:        register int size = siz;
        !            12: 
        !            13:        if (*var == 0 || *var + size > _maxptr || *var < _minptr) {
        !            14:                ERROR("Pointer value out of legal range\n", 0);
        !            15:                return;
        !            16:        }
        !            17:        free(*var);
        !            18:        if (*var == _minptr)
        !            19:                _minptr += size;
        !            20:        if (*var + size == _maxptr)
        !            21:                _maxptr -= size;
        !            22:        *var = (char *)(0);
        !            23: }

unix.superglobalmegacorp.com

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