MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FCEU_amalloc

Function FCEU_amalloc

src/utils/memory.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include "memory.h"
30
31void *FCEU_amalloc(size_t size, size_t alignment)
32{
33 size = (size + alignment - 1) & ~(alignment-1);
34
35 #ifdef _MSC_VER
36 void *ret = _aligned_malloc(size,alignment);
37 #else
38 void *ret = aligned_alloc(alignment,size);
39 #endif
40
41 if(!ret)
42 FCEU_abort("Error allocating memory!");
43
44 return ret;
45}
46
47void FCEU_afree(void* ptr)
48{

Callers 1

FCEU_InitVirtualVideoFunction · 0.85

Calls 1

FCEU_abortFunction · 0.85

Tested by

no test coverage detected