Type-5 Page Allocation
misson20000 opened this issue · 0 comments
misson20000 commented
The lack of having a way to allocate contiguous type-5 memory is now blocking a number of hacks.
- https://github.com/reswitched/libtransistor-retroarch/commit/8cd29904018bff45c6090b6c822acd87e63a6628#diff-e484c82e4f20c1fcd08b73abd69671bdR30
- https://github.com/reswitched/libtransistor/blob/audio/test/test_audio_output.c#L24
- https://github.com/reswitched/libtransistor/blob/graphics-experimental/lib/display/surface.c#L10
The proposed API is to pass a function pointer in libtransistor_context
for void *(*alloc_pages)(size_t min, size_t max, size_t *actual)
. For allocations such as those listed above, min
would equal max
. For allocating space for the heap, min
can be 0x1000 so that we can allocate any small blocks that may exist, since we're going to be mapping them anyway and can't use them for much else.