* This function sets the soft and hard limit for runtime resources. When the limit
* is reached, a user-specified callback is called. The callback runs in a restricted
* environment, in which the world coult be stopped, so it can't take locks, perform
* allocations etc. The callback may be called multiple times once a limit has been reached
* if action is not taken to decrease the resource use.
* This function sets the soft and hard limit for runtime resources. When the limit
* is reached, a user-specified callback is called. The callback runs in a restricted
* environment, in which the world coult be stopped, so it can't take locks, perform
* allocations etc. The callback may be called multiple times once a limit has been reached
* if action is not taken to decrease the resource use.