Annotation of 40BSD/lib/libpc/DISPOSE.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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