Real-Time Embedded Multithreading: Using ThreadX and ARM

Appendix B: Memory Byte Pool Services

The memory byte pool services described in this appendix are:

tx_byte_allocate

Allocate bytes of memory

tx_byte_pool_create

Create a memory pool of bytes

tx_byte_pool_delete

Delete a memory pool of bytes

tx_byte_pool_info_get

Retrieve information about a byte pool

tx_byte_pool_prioritize

Prioritize the byte pool suspension list

tx_byte_release

Release bytes back to the memory pool

tx_byte_allocate

Allocate bytes of memory from a memory byte pool

Prototype

UINT <b class="bold">tx_byte_allocate</b>(TX_BYTE_POOL <b class="bold">*pool_ptr</b>,                      VOID <b class="bold">**memory_ptr</b>, ULONG <b class="bold">memory_size</b>,                      ULONG <b class="bold">wait_option</b>)

Description

This service allocates the specified number of bytes from the specified byte memory pool. This service modifies the Memory Pool Control Block through the parameter pool_ptr.

Note

The performance of this service is a function of the block size and the amount of fragmentation in the pool. Hence, this service should not be used during time-critical threads of execution.

Input Parameters

pool_ptr

Pointer to a previously created memory byte pool s Control Block.

memory_size

Number of bytes requested.

wait_option

Defines how the service behaves if there is not enough memory available. The wait options are defined as follows:

TX_NO_WAIT (0x00000000)

TX_WAIT_FOREVER (0xFFFFFFFF)

timeout value (0x00000001 to 0xFFFFFFFE, inclusive)

Selecting TX_NO_WAIT results in an immediate return from this service regardless of whether or not it was successful. This is...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Memory Chips
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.