(VITA) Allow cores to define heap size
This commit is contained in:
parent
f0d1a733e3
commit
adfbd233ee
|
@ -8,6 +8,7 @@ static char _newlib_sbrk_mutex[32] __attribute__ ((aligned (8)));
|
||||||
|
|
||||||
static int _newlib_vm_memblock;
|
static int _newlib_vm_memblock;
|
||||||
|
|
||||||
|
extern int _newlib_heap_size_user __attribute__((weak));
|
||||||
extern int _newlib_vm_size_user __attribute__((weak));
|
extern int _newlib_vm_size_user __attribute__((weak));
|
||||||
|
|
||||||
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
|
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
|
||||||
|
@ -48,7 +49,11 @@ void _init_vita_heap(void) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (&_newlib_heap_size_user != NULL) {
|
||||||
_newlib_heap_size = _newlib_heap_size_user;
|
_newlib_heap_size = _newlib_heap_size_user;
|
||||||
|
}else{
|
||||||
|
_newlib_heap_size = 192 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
_newlib_heap_size -= _newlib_vm_size;
|
_newlib_heap_size -= _newlib_vm_size;
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include <psp2/appmgr.h>
|
#include <psp2/appmgr.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
int _newlib_heap_size_user = 192 * 1024 * 1024;
|
|
||||||
|
|
||||||
#include "../../bootstrap/vita/sbrk.c"
|
#include "../../bootstrap/vita/sbrk.c"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue