home *** CD-ROM | disk | FTP | other *** search
- /*
- * FILE
- * malloc.c
- *
- * DESCRIPTION
- * allocate memory
- *
- * SEE ALSO
- * free()
- *
- * TODO
- * Används errno-variabeln.
- */
-
- #include <exec/types.h>
- #include <exec/memory.h>
-
- #include <proto/exec.h>
-
- void *
- malloc(unsigned int size)
- {
- register long * ptr;
-
- if (ptr = (long *)AllocMem(size+4, MEMF_PUBLIC)) {
- ptr[0] = size+4;
-
- ptr++;
- }
- return((void *)ptr);
- }
-