Annotation of coherent/d/usr/lib/libmp/mpalloc.c, revision 1.1

1.1     ! root        1: #include "mprec.h"
        !             2: 
        !             3: char   *malloc();
        !             4: #ifndef NULL
        !             5: #define NULL   ((char *)0)
        !             6: #endif
        !             7: 
        !             8: 
        !             9: /*
        !            10:  *     Mpalc allocates space for either a multi-precision value or
        !            11:  *     a mint.  It does not return unless the space is available.
        !            12:  *     "Size" is the number of bytes that the value requires.
        !            13:  */
        !            14: 
        !            15: char *
        !            16: mpalc(size)
        !            17: unsigned size;
        !            18: {
        !            19:        register char *result;
        !            20: 
        !            21:        result = (char *) malloc(size);
        !            22:        if (result == NULL)
        !            23:                mperr("No space for value");
        !            24:        return (result);
        !            25: }
        !            26: 
        !            27: 
        !            28: /*
        !            29:  *     Mpfree is used to free any space allocated by malloc.
        !            30:  *     Note that if "blkp" is NULL, then nothing should be done.
        !            31:  */
        !            32: 
        !            33: void
        !            34: mpfree(blkp)
        !            35: register char  *blkp;
        !            36: {
        !            37:        if (blkp != NULL)
        !            38:                free(blkp);
        !            39: }

unix.superglobalmegacorp.com

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