mirror of https://github.com/mgba-emu/mgba.git
Util: Use anonymousMemoryMap for RingFIFO memory
This commit is contained in:
parent
5bed376e5c
commit
c14da05d8d
|
@ -6,14 +6,14 @@
|
||||||
#include "ring-fifo.h"
|
#include "ring-fifo.h"
|
||||||
|
|
||||||
void RingFIFOInit(struct RingFIFO* buffer, size_t capacity, size_t maxalloc) {
|
void RingFIFOInit(struct RingFIFO* buffer, size_t capacity, size_t maxalloc) {
|
||||||
buffer->data = malloc(capacity);
|
buffer->data = anonymousMemoryMap(capacity);
|
||||||
buffer->capacity = capacity;
|
buffer->capacity = capacity;
|
||||||
buffer->maxalloc = maxalloc;
|
buffer->maxalloc = maxalloc;
|
||||||
RingFIFOClear(buffer);
|
RingFIFOClear(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RingFIFODeinit(struct RingFIFO* buffer) {
|
void RingFIFODeinit(struct RingFIFO* buffer) {
|
||||||
free(buffer->data);
|
memoryMapFree(buffer->data, buffer->capacity);
|
||||||
buffer->data = 0;
|
buffer->data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue