DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3c6a4fc28⟧ TextFile

    Length: 644 (0x284)
    Types: TextFile
    Notes: UNIX file
    Names: »mpalloc.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libmp/mpalloc.c« 

TextFile

#include "mprec.h"

char	*malloc();
#ifndef NULL
#define NULL	((char *)0)
#endif


/*
 *	Mpalc allocates space for either a multi-precision value or
 *	a mint.  It does not return unless the space is available.
 *	"Size" is the number of bytes that the value requires.
 */

char *
mpalc(size)
unsigned size;
{
	register char *result;

	result = (char *) malloc(size);
	if (result == NULL)
		mperr("No space for value");
	return (result);
}


/*
 *	Mpfree is used to free any space allocated by malloc.
 *	Note that if "blkp" is NULL, then nothing should be done.
 */

void
mpfree(blkp)
register char	*blkp;
{
	if (blkp != NULL)
		free(blkp);
}