Annotation of frontvm/hardware/memAlloc.c, revision 1.1

1.1     ! root        1: /*
        !             2:   Hatari
        !             3: 
        !             4:   Memory Functions
        !             5: */
        !             6: 
        !             7: #include "main.h"
        !             8: #include "memAlloc.h"
        !             9: 
        !            10: 
        !            11: /*-----------------------------------------------------------------------*/
        !            12: /*
        !            13:   Allocate memory from Windows
        !            14: */
        !            15: void *Memory_Alloc(int nBytes)
        !            16: {
        !            17:   void *pAlloc;
        !            18: 
        !            19:   /* Allocate our memory */
        !            20:   pAlloc = malloc(nBytes);
        !            21:   if (pAlloc==NULL) {
        !            22:     Main_SysError("Out of Memory!\n\nPlease close all running applications and\ncheck you are not running low on disc space.\n",PROG_NAME);
        !            23:     exit(0);
        !            24:   }
        !            25: 
        !            26:   return(pAlloc);
        !            27: }
        !            28: 
        !            29: 
        !            30: /*-----------------------------------------------------------------------*/
        !            31: /*
        !            32:   Free memory back to Windows
        !            33: */
        !            34: void Memory_Free(void *pAlloc)
        !            35: {
        !            36:   /* Free our memory */
        !            37:   free(pAlloc);
        !            38: }
        !            39: 
        !            40: 
        !            41: /*-----------------------------------------------------------------------*/
        !            42: /*
        !            43:   Set memory block to byte value
        !            44: */
        !            45: void *Memory_Set(void *pAlloc, int c, size_t count)
        !            46: {
        !            47:   /* Set memory region */
        !            48:   return(memset(pAlloc,c,count));
        !            49: }
        !            50: 
        !            51: 
        !            52: /*-----------------------------------------------------------------------*/
        !            53: /*
        !            54:   Set memory block to zero
        !            55: */
        !            56: void *Memory_Clear(void *pAlloc, size_t count)
        !            57: {
        !            58:   /* Clear out memory region */
        !            59:   return(memset(pAlloc,0x0,count));
        !            60: }

unix.superglobalmegacorp.com

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