GNATS-RTEMS rtems/536: patch.

Sergei Organov osv at
Wed Dec 24 15:31:36 UTC 2003

Attached is patch against rtems-ss-20030703 to fix PR rtems/536.

Tested on custom PowerPC-based BSP (32 bit target).

The improvements are:

1. Only one word per used block overhead compared to 2 words + page_size for
   previous implementation while user pointers returned are still aligned on
   page_size boundary.

2. New _Heap_Allocate_aligned() routine is provided to request arbitrary
   aligned memory (could be used to implement memalign() call.)

3. Heap statistics is gathered at run time providing more information about
   the heap than those available from _Heap_Get_information() while imposing
   little overhead.

4. Designed for 16/32/64 bit targets (tested on 32 bit target only).

2003-12-24  Sergei Organov  <osv at>

	PR rtems/536
	Heap manager re-implemented to consume less memory and still satisfy
	alignment requirements.
	* src/heap.c, src/heapallocate.c, src/heapextend.c,
	src/heapfree.c, src/heapgetinfo.c, src/heapsizeofuserarea.c,
	src/heapwalk.c, macros/rtems/score/heap.inl,
	inline/rtems/score/heap.inl, include/rtems/score/heap.h:
	re-implemented, refer to heap.h/heap.c for description.
	* src/heapallocatealigned.c: new file.
	* (HEAP_C_FILES): added src/heapallocatealigned.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-heap-rtems-ss-20030703.patch
Type: text/x-patch
Size: 76371 bytes
Desc: Fix for PR rtems/536
URL: <>

More information about the users mailing list