69,7 → 69,6 |
} |
|
static size_t heapsize = 0; |
static size_t maxheapsize = (size_t)(-1); |
/* Start of heap linker symbol */ |
extern char _heap; |
|
92,8 → 91,6 |
/* Check for too small values */ |
if (incr < 0 && incr+heapsize > heapsize) |
return NULL; |
/* Check for user limit */ |
if ((maxheapsize!=(size_t)(-1)) && (heapsize + incr)>maxheapsize) return NULL; |
|
rc = as_area_resize(&_heap, heapsize + incr,0); |
if (rc != 0) |
106,11 → 103,3 |
|
return res; |
} |
|
void *set_maxheapsize(size_t mhs) |
{ |
maxheapsize=mhs; |
/* Return pointer to area not managed by sbrk */ |
return (void *)&_heap + maxheapsize; |
|
} |