diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-08-09 10:17:42 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-10-25 14:54:06 +0200 |
commit | 6ccfe722bda09ab469d4a9cb2d78666f16955607 (patch) | |
tree | 9a66773bb58ec4220460012d265ce4b7304c0d8f /cpukit/score/src/pheapextend.c | |
parent | libcsupport: malloc_deferred_frees_initialize() (diff) | |
download | rtems-6ccfe722bda09ab469d4a9cb2d78666f16955607.tar.bz2 |
score: Change _Heap_Extend() API
The _Heap_Extend() has now the same signature as _Heap_Initialize().
The 4th parameter is ignored (page size in _Heap_Initialize()).
Add Heap_Area and Heap_Initialization_or_extend_handler.
Add and test _Heap_No_extend().
This helps to do a table based heap initialization and extension.
Create a table of Heap_Area elements and iterate through it. Set the
handler to _Heap_Initialize() in the first iteration and then to
_Heap_Extend().
Diffstat (limited to 'cpukit/score/src/pheapextend.c')
-rw-r--r-- | cpukit/score/src/pheapextend.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/score/src/pheapextend.c b/cpukit/score/src/pheapextend.c index be23c706e3..5f1a4df8a6 100644 --- a/cpukit/score/src/pheapextend.c +++ b/cpukit/score/src/pheapextend.c @@ -28,12 +28,11 @@ bool _Protected_heap_Extend( uintptr_t size ) { - bool extend_ok; uintptr_t amount_extended; _RTEMS_Lock_allocator(); - extend_ok = _Heap_Extend(the_heap, starting_address, size, &amount_extended); + amount_extended = _Heap_Extend( the_heap, starting_address, size, 0 ); _RTEMS_Unlock_allocator(); - return extend_ok; -} + return amount_extended != 0; +} |