mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 00:40:09 +00:00
[VITA] Align VM block size to 1MB
This commit is contained in:
parent
93174dcd19
commit
9f90833d2b
@ -15,6 +15,8 @@ static int _newlib_vm_memblock;
|
|||||||
extern int _newlib_heap_size_user __attribute__((weak));
|
extern int _newlib_heap_size_user __attribute__((weak));
|
||||||
extern int _newlib_vm_size_user __attribute__((weak));
|
extern int _newlib_vm_size_user __attribute__((weak));
|
||||||
|
|
||||||
|
#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
|
||||||
|
|
||||||
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
|
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
|
||||||
if (sceKernelLockLwMutex((struct SceKernelLwMutexWork*)_newlib_sbrk_mutex, 1, 0) < 0)
|
if (sceKernelLockLwMutex((struct SceKernelLwMutexWork*)_newlib_sbrk_mutex, 1, 0) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -36,8 +38,8 @@ void _init_vita_heap(void) {
|
|||||||
|
|
||||||
int _newlib_vm_size = 0;
|
int _newlib_vm_size = 0;
|
||||||
if (&_newlib_vm_size_user != NULL) {
|
if (&_newlib_vm_size_user != NULL) {
|
||||||
_newlib_vm_size = _newlib_vm_size_user;
|
_newlib_vm_size = ALIGN(_newlib_vm_size_user, 0x100000);
|
||||||
_newlib_vm_memblock = sceKernelAllocMemBlockForVM("code", _newlib_vm_size_user);
|
_newlib_vm_memblock = sceKernelAllocMemBlockForVM("code", _newlib_vm_size);
|
||||||
|
|
||||||
if (_newlib_vm_memblock < 0){
|
if (_newlib_vm_memblock < 0){
|
||||||
//sceClibPrintf("sceKernelAllocMemBlockForVM failed\n");
|
//sceClibPrintf("sceKernelAllocMemBlockForVM failed\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user