Skip to content

Commit cf22283

Browse files
authored
Adjust the description of out-of-bounds array access consequences.
Implements the changes proposed in issue #8 to ensure the documentation is aligned with the C language standard.
1 parent 62b46b0 commit cf22283

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rtos-docs/threadx/chapter4.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ UINT tx_block_allocate(
151151
152152
This service allocates a fixed-size memory block from the specified memory pool. The actual size of the memory block is determined during memory pool creation.
153153
154-
IMPORTANT: _It is important to ensure application code does not write outside the allocated memory block. If this happens, corruption occurs in an adjacent (usually subsequent) memory block. The results are unpredictable and often fatal!_
154+
IMPORTANT: _It is important to ensure application code does not write outside the allocated memory block. If this happens, the behavior is undefined. Likewise, if the destination is not large enough, the behavior is undefined. That said, a typical consequence is memory corruption of an adjacent (usually subsequent) memory area. The results are unpredictable and often fatal!_
155155
156156
=== Parameters
157157
@@ -671,7 +671,7 @@ UINT tx_byte_allocate(
671671
672672
This service allocates the specified number of bytes from the specified memory byte pool.
673673
674-
IMPORTANT: _It is important to ensure application code does not write outside the allocated memory block. If this happens, corruption occurs in an adjacent (usually subsequent) memory block. The results are unpredictable and often fatal!_
674+
IMPORTANT: _It is important to ensure application code does not write outside the allocated memory block. If this happens, the behavior is undefined. Likewise, if the destination is not large enough, the behavior is undefined. That said, a typical consequence is memory corruption of an adjacent (usually subsequent) memory area. The results are unpredictable and often fatal!_
675675
676676
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._
677677
@@ -2819,7 +2819,7 @@ UINT tx_queue_receive(
28192819
28202820
This service retrieves a message from the specified message queue. The retrieved message is *copied* from the queue into the memory area specified by the destination pointer. That message is then removed from the queue.
28212821
2822-
IMPORTANT: _The specified destination memory area must be large enough to hold the message; i.e., the message destination pointed to by_ *_destination_ptr_* _must be at least as large as the message size for this queue. Otherwise, if the destination is not large enough, memory corruption occurs in the following memory area._
2822+
IMPORTANT: _The specified destination memory area must be large enough to hold the message; i.e., the message destination pointed to by_ *_destination_ptr_* _must be at least as large as the message size for this queue. If the destination is not large enough, the behavior is undefined. That said, a typical consequence is memory corruption of an adjacent (usually subsequent) memory area._
28232823
28242824
=== Parameters
28252825

0 commit comments

Comments
 (0)