File:  [Tom Morton FrontierVM] / frontvm / hardware / memAlloc.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:57:15 2018 UTC (8 years, 2 months ago) by root
Branches: frontvm, MAIN
CVS tags: frontvm2-20061120, frontvm-20040517, HEAD
Tom Morton

/*
  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.