@CHIP-RTOS C Library - BeckHeap Optional Library
IPC@CHIP® Documentation Index
The BeckHeap library provides a multi-tasking alternate heap implementation for the application program's far heap. All functions are re-entrant and thread safe.
This far heap implementation has two primary advantages over the Pardigm-Beck standard Run-Time Library (RTL) far heap wrapped with the heap.c source file.
The memory gap problem, encountered when the RTL far heap could not grow due to a subseqeuent application program occupying the system memory following your program, is solved by using multiple "heap regions". Each heap region managed by the BeckHeap is essentially (software wise) an independent heap. So this far heap is implemented using a collection of heaps which may be scattered around the @CHIP-RTOS system memory. This implementation is then hidden so that these multiple heaps appear to the application programmer as a single far heap.
Neither of these two problems exists for the RTL near heap, used by the SMALL or MEDIUM memory models. So the heap.c source file is sufficient for protecting the near heap for multi-tasking access. The BeckHeap library applies only to the far heap. SMALL or MEDIUM memory model programs may use the BeckHeap library for their far heap.
For COMPACT, LARGE and HUGE memory models the "far heap" is the one and only heap within the program. The only difference between farmalloc() and malloc() in these cases is the amount of memory which can be allocated by the call.
A set of debug functions is provided to assist with tracking down dynamic memory problems.
One of the following libraries must be selected based on your program's memory model, and included in your project when this alternative heap is desired.
For performance reasons, it is recommended that you use the optional HugePtr library when ever the BeckHeap library is used. The HugePtr library provides very fast huge pointer arithmetic for internal use by the C compiler.
End of document