ABSTRACT

This chapter focuses on two ThreadX memory management resources that provide a good deal of flexibility: memory byte pools and memory block pools. It considers the features, capabilities, pitfalls, and services for each type. A memory byte pool is a contiguous block of bytes. Within such a pool, byte groups of any size may be used and reused. A memory block pool is also a contiguous block of bytes, but it is organized into a collection of fixed-size memory blocks. Thus, the amount of memory used or reused from a memory block pool is always the same—the size of one fixed-size memory block. The use of memory block pools is preferred over memory byte pools. The number of allocatable bytes in a memory byte pool is slightly less than what was specified during creation. This is because management of the free memory area introduces some overhead. Application threads can suspend while waiting for memory bytes from a pool.