The memory limit environment handler is not a code entry point. Instead, the value specified in R1 to OS_ChangeEnvironment is used to set a soft limit on how much memory an application can use from application space.
The limit set here is the same value as the RAM limit that OS_GetEnv returns in R1.
The limit should be specified as an absolute address (i.e. &8000 would correspond to 0 bytes of application space), and must be less than the limit set by the Application Space Handler.
When a program spawns a child, e.g. as a result of system()
from a C program, the memory limit is often used in order to prevent the child from overwriting the parent. However setting a memory limit will usually prevent the child from automatically resizing application space, e.g. if the child is a Wimp task then Wimp_SlotSize will not allow its wimpslot to be resized.