With larger memory available to many systems it is necessary to limit the allocations of the maximum dynamic area size. The 'SetClamps' reason code provides that limitation.
OS_DynamicArea SetClamps (8)
Set clamps on max size of dynamic areas created by subsequent calls to OS_DynamicArea 0
R0 = 8 R1 = limit on maximum size of non-sparse areas created by OS_DynamicArea 0 with R5 = -1 (that is, areas with 'memory size' selected), 0 to read, or -1 for memory size R2 = limit on maximum size of non-sparse areas created by OS_DynamicArea 0 with R5 = 0 (that is, areas which specify a size), 0 to read, or -1 for memory size R3 = limit on maximum size of sparse areas created by OS_DynamicArea 0 with R4 bit 10 set (that is, Sparse Dynamic Areas), or 0 to read
R1 = previous limit for OS_DynamicArea 0 with R5 = -1 R2 = previous limit for OS_DynamicArea 0 with R5 > 0 R3 = previous limit for OS_DynamicArea 0 with R4 bit 10 set
This SWI is used to change the 'clamping' levels on dynamic area creation. On machines with large amounts of memory clients which previously requested dynamic areas which could be as large as the memory of the machine could very quickly use up all the logical address space. This call allows dynamic area requests to be limited to set maximum sizes.
This reason code is intended for configuration only. Because of its global effect it should only be used by configuration utilities and not by applications.
Specifying -1 in R1 or R2 means that the respective clamp is the RAM limit of the machine (this is the kernel default). Specifying larger than the RAM limit in R1 or R2 is equivalent to specifying -1.
Specifying -1 for R3 is invalid (there is no concept of RAM limit for Sparse areas). The kernel default is for no explicit limit on Sparse area maximum size. This means that the effective limit is then the size of the largest fragment of logical address space free at creation time.
There is never any limit on the size of physically mapped dynamic areas which may be created.
There is a minimum clamp limit of 1Mb; this is determined by the granularity of the machine's memory.
This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.
HTML document version 1.03 3rd November 2015