File:  [HATARI the Atari ST Emulator] / hatari / src / memAlloc.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Mon Apr 1 07:09:39 2019 UTC (7 years, 2 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari00060, hatari00050, hatari00045, hatari00040, hatari00030, hatari00025, hatari00020, hatari00011, HEAD
hatari 0.11

/*
  Hatari

  Memory Functions
*/

#include "main.h"
#include "memAlloc.h"


/*-----------------------------------------------------------------------*/
/*
  Allocate memory from Windows
*/
void *Memory_Alloc(int nBytes)
{
  void *pAlloc;

  /* Allocate our memory */
  pAlloc = malloc(nBytes);
  if (pAlloc==NULL) {
    Main_SysError("Out of Memory!\n\nPlease close all running applications and\ncheck you are not running low on disc space.\n",PROG_NAME);
    exit(0);
  }

  return(pAlloc);
}


/*-----------------------------------------------------------------------*/
/*
  Free memory back to Windows
*/
void Memory_Free(void *pAlloc)
{
  /* Free our memory */
  free(pAlloc);
}


/*-----------------------------------------------------------------------*/
/*
  Set memory block to byte value
*/
void *Memory_Set(void *pAlloc, int c, size_t count)
{
  /* Set memory region */
  return(memset(pAlloc,c,count));
}


/*-----------------------------------------------------------------------*/
/*
  Set memory block to zero
*/
void *Memory_Clear(void *pAlloc, size_t count)
{
  /* Clear out memory region */
  return(memset(pAlloc,0x0,count));
}

unix.superglobalmegacorp.com

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