<div dir="ltr">I had reviewed rbheap code and i have some comments <div><br></div><div><ul><li>first </li></ul></div><div><div>rtems_status_code rtems_rbheap_initialize(</div><div>  rtems_rbheap_control *control,</div><div>
  void *area_begin,</div><div>  uintptr_t area_size,</div><div>  uintptr_t alignment,</div><div>  rtems_rbheap_extend_descriptors extend_descriptors,</div><div>  void *handler_arg</div><div>);</div></div><div><br></div><div>
this function initialize just one area of memory to be manipulated by rbheap manager , and it behaves like rtems_partition_create( ) and rtems_region_create. I am thinking the initializing function initialize rtems_rbheap_control with a MAXIMUM rnheap control </div>
<div>struct number to support more than one rbheap managed memory area. </div><div><br></div><div><ul><li>Second </li></ul><div><div> * The red-black tree heap provides a memory allocator suitable to implement</div><div> * the malloc() and free() interface.  It uses a first-fit allocation strategy.</div>
<div> * In the red-black tree heap the administration data structures are not</div><div> * contained in the managed memory area.  Thus writing beyond the boundaries of</div><div> * a chunk does not damage the data to maintain the heap.  This can be used for</div>
<div> * example in a task stack allocator which protects the task stacks from access</div><div> * by other tasks.  The allocated and free memory parts of the managed area are</div><div> * called chunks.  Each chunk needs a descriptor which is stored outside of the</div>
<div> * managed area.</div></div><div><br></div><div> The comment (which is in the rbheap.h file )indicated that we can use rbheap as a task stack allocator and protect each  task stacks from access by other tasks. I guessed that memory protection attributes would exist in rtems_rbheap_chunk struct , </div>
</div><div>but i did not found anything related to memory protection so far. So my question how rbheap could be used to allocate stacks for tasks that one task can not corrupt other task stack ?</div></div>