forked from Imagelibrary/rtems
* ChangeLog, libcsupport/src/malloc.c, libcsupport/src/mallocfreespace.c, sapi/include/confdefs.h, score/Makefile.am, score/preinstall.am: malloc never blocks so the Region Manager is quite heavy for implementing this. This patch implements the C Program Heap directly in terms of the new Protected Heap handler. This handler is a direct use of a SuperCore Heap in conjunction with the Allocator Mutex used internally by RTEMS. This saves 3184 bytes on most SPARC test executables. * score/include/rtems/score/protectedheap.h, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: New files.
34 lines
745 B
C
34 lines
745 B
C
/**
|
|
* COPYRIGHT (c) 1989-2007.
|
|
* On-Line Applications Research Corporation (OAR).
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <rtems/system.h>
|
|
#include <rtems/score/protectedheap.h>
|
|
|
|
boolean _Protected_heap_Extend(
|
|
Heap_Control *the_heap,
|
|
void *starting_address,
|
|
size_t size
|
|
)
|
|
{
|
|
Heap_Extend_status status;
|
|
uint32_t amount_extended;
|
|
|
|
_RTEMS_Lock_allocator();
|
|
status = _Heap_Extend(the_heap, starting_address, size, &amount_extended);
|
|
_RTEMS_Unlock_allocator();
|
|
return (status == HEAP_EXTEND_SUCCESSFUL);
|
|
}
|
|
|