2012-06-03 15:48:14 +00:00
|
|
|
#ifndef _MDFN_MEMORY_H
|
2012-10-26 16:00:14 +00:00
|
|
|
#define _MDFN_MEMORY_H
|
2012-06-03 15:48:14 +00:00
|
|
|
|
|
|
|
// These functions can be used from driver code or from internal Mednafen code.
|
2012-10-13 13:31:49 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2012-06-03 15:48:14 +00:00
|
|
|
|
2012-11-10 20:35:26 +00:00
|
|
|
#define MDFN_malloc(size, purpose) malloc(size)
|
|
|
|
#define MDFN_calloc(nmemb, size, purpose) calloc(nmemb, size)
|
|
|
|
#define MDFN_realloc(ptr, size, purpose) realloc(ptr, size)
|
2012-06-03 15:48:14 +00:00
|
|
|
|
2012-11-10 20:35:26 +00:00
|
|
|
#define MDFN_malloc_real(size, purpose) malloc(size)
|
|
|
|
#define MDFN_calloc_real(nmemb, size, purpose) calloc(nmemb, size)
|
|
|
|
#define MDFN_realloc_real(ptr, size, purpose) realloc(ptr, size)
|
|
|
|
#define MDFN_free(ptr) free(ptr)
|
2012-06-03 15:48:14 +00:00
|
|
|
|
|
|
|
static inline void MDFN_FastU32MemsetM8(uint32_t *array, uint32_t value_32, unsigned int u32len)
|
|
|
|
{
|
2012-10-13 13:31:49 +00:00
|
|
|
for(uint32_t *ai = array; ai < array + u32len; ai += 2)
|
2012-06-03 15:48:14 +00:00
|
|
|
{
|
|
|
|
ai[0] = value_32;
|
|
|
|
ai[1] = value_32;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|