Showing changes from revision #2 to #3:
Added | Removed | Changed
Entry | |
---|---|
R0 | 7 |
R1 | Pointer to heap |
R2 | Required alignment, 0 for none |
R3 | Size to claim |
R4 | Required boundary, 0 for none |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved |
R2 | Pointer to block, or 0 if failed |
R3 | Preserved |
R4 | Preserved |
The purpose of this call is to claim an aligned section of the heap. Use the alignment value to guarantee the minimum alignment of the returned pointer. Use the boundary value to guarantee that the allocation doesn’t cross from one section of memory to another. For example, if you were to allocate a block of memory with an alignment of 32 and boundary of 4096, then the returned pointer is guaranteed to be at least 32 byte aligned, and all the data will reside within the same (4KB) page.
Alignment and boundary values must be powers of two. The boundary value, if specified, must be greater than or equal to the block size.
If a block is resized using OS_Heap 4, there is no guarantee that the updated block will satisfy the original alignment and boundary constraints.
This reason code first became available in RISC OS 5.17