(VITA) Allow cores to define heap size

This commit is contained in:
Francisco José García García 2016-10-11 09:40:55 +02:00
parent f0d1a733e3
commit adfbd233ee
2 changed files with 15 additions and 12 deletions

View File

@ -8,6 +8,7 @@ static char _newlib_sbrk_mutex[32] __attribute__ ((aligned (8)));
static int _newlib_vm_memblock;
extern int _newlib_heap_size_user __attribute__((weak));
extern int _newlib_vm_size_user __attribute__((weak));
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
@ -48,7 +49,11 @@ void _init_vita_heap(void) {
goto failure;
}
if (&_newlib_heap_size_user != NULL) {
_newlib_heap_size = _newlib_heap_size_user;
}else{
_newlib_heap_size = 192 * 1024 * 1024;
}
_newlib_heap_size -= _newlib_vm_size;

View File

@ -29,8 +29,6 @@
#include <psp2/appmgr.h>
#include <pthread.h>
int _newlib_heap_size_user = 192 * 1024 * 1024;
#include "../../bootstrap/vita/sbrk.c"
#else