h6. [[OS SWI Calls]] h6(. » [[OS_ChangeEnvironment]] h6((. » Memory Limit Handler h2. Memory Limit Handler h4. Use 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. h4. Notes 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 <code>system()</code> from a C program, the memory limit is often used in order to prevent the child from overwriting the parent (assuming the parent has relocated itself to the top of the allocated application space). However setting a memory limit will usually prevent the child from automatically resizing application space, e.g. [[Wimp_SlotSize]] does not allow resizing of a tasks wimpslot if the soft memory limit does not match the [[Application Space Handler|actual limit]]. h4. See also * [[Application Space Handler]] * [[OS_GetEnv]] * [[Wimp_SlotSize]]