Hello,

another use case for a weak function could be the heap. If you only allocate memory and never free it, then the implementation can be very simple:

https://git.rtems.org/rtems/tree/cpukit/score/src/memoryallocate.c#n49

We could use something like this in heapallocate.c:

RTEMS_WEAK void *_Heap_Allocate_impl(size) { /* Very simple */ }

void *_Heap_Allocate(size)

{

  return _Heap_Allocate_impl(size)

}

In heapfree.c:

void *_Heap_Allocate_impl(size) { /* Complex */ }

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to