Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Real-Time Memory Management Alternate APIs for RTKernel-32 |
Real-Time Memory ManagementIn C/C++, memory management is normally performed using malloc, free, realloc, new, etc. The run-time system's heap offers great flexibility and efficiency, but it cannot fulfil real-time requirements. The run-time requirements are non-deterministic. In addition, they may require blocking task switches, which makes them unusable for interrupt handlers. RTKernel-32 offers memory management with real-time capabilities through Memory Pools. A Memory Pool is an isolated heap with data buffers of equal size. Any number of memory pools can exist simultaneously. A pool is initialized once and allocated a certain number of buffers. Thereafter, buffers can be allocated and deallocated from the pool under real-time conditions using the functions RTKGetBuffer and RTKFreeBuffer. Both functions are completely reentrant (even for one and the same pool), can be used in both tasks and interrupt handlers and have very small execution times (about 2 microseconds on a 486/33). All memory pool API functions of RTKernel-32 are documented in the RTKernel-32 Reference Manual.
|