From 5f2ed6c85a141499e8d1e2fdf1bb9f34e732f57b Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 25 Jan 2022 05:19:00 +0200 Subject: [PATCH] VITA: don't fail if vm_memblock can't be allocated (#13545) Failing here is catastrophic because we get no heap, the whole thing just crashes and leaves nothing in the logs. vm_memblock is not even used by RetroArch, it's just used by cores with dynarecs, so let the cores themselves deal with problems if they arise. --- bootstrap/vita/sbrk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bootstrap/vita/sbrk.c b/bootstrap/vita/sbrk.c index b15f5eb8e2..876f3b8b79 100644 --- a/bootstrap/vita/sbrk.c +++ b/bootstrap/vita/sbrk.c @@ -43,7 +43,6 @@ void _init_vita_heap(void) { if (_newlib_vm_memblock < 0){ //sceClibPrintf("sceKernelAllocMemBlockForVM failed\n"); - goto failure; } }else{ _newlib_vm_memblock = 0; @@ -99,8 +98,8 @@ void _free_vita_heap(void) { // Free the heap memblock to avoid memory leakage. sceKernelFreeMemBlock(_newlib_heap_memblock); - if(_newlib_vm_memblock) - sceKernelFreeMemBlock(_newlib_vm_memblock); + if (_newlib_vm_memblock > 0) + sceKernelFreeMemBlock(_newlib_vm_memblock); _newlib_vm_memblock = 0; _newlib_heap_memblock = 0;