all repos — mgba @ c14da05d8dca225010677643c32fea5c0ac8517a

mGBA Game Boy Advance Emulator

Util: Use anonymousMemoryMap for RingFIFO memory
Jeffrey Pfau jeffrey@endrift.com
Fri, 04 Sep 2015 01:48:52 -0700
commit

c14da05d8dca225010677643c32fea5c0ac8517a

parent

5bed376e5cbc412db156b5046099b560a244d8f3

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/util/ring-fifo.csrc/util/ring-fifo.c

@@ -6,14 +6,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "ring-fifo.h" void RingFIFOInit(struct RingFIFO* buffer, size_t capacity, size_t maxalloc) { - buffer->data = malloc(capacity); + buffer->data = anonymousMemoryMap(capacity); buffer->capacity = capacity; buffer->maxalloc = maxalloc; RingFIFOClear(buffer); } void RingFIFODeinit(struct RingFIFO* buffer) { - free(buffer->data); + memoryMapFree(buffer->data, buffer->capacity); buffer->data = 0; }