/* use mallinfo() to monitor allocated space. It is linux specific but other methods don't work:
* setrlimit() RLIMIT_DATA doesn't count memory allocated via mmap() (which is used internally by malloc)
* setrlimit() RLIMIT_AS works but also counts virtual memory allocated by thread stacks, which is very big and hardly controllable.
* setrlimit() RLIMIT_AS works but also counts virtual memory allocated by thread stacks, which is very big and
* hardly controllable.
* setrlimit() RLIMIT_RSS does nothing interesting on linux.
* getrusage() of RSS is unreliable: memory blocks can be leaked without being read or written, which would not appear in RSS.
* getrusage() of RSS is unreliable: memory blocks can be leaked without being read or written, which would not
* appear in RSS.
* mallinfo() itself is the less worse solution. Allocated bytes are returned as 'int' so limited to 2GB
*/
if(max_vm_kb){
if(max_vm_kb){
structmallinfominfo=mallinfo();
if(minfo.uordblks>max_vm_kb*1024){
bc_tester_printf(bc_printf_verbosity_error,"The program exceeded the maximum ammount of memory allocatable (%i bytes), aborting now.\n",minfo.uordblks);
if(minfo.uordblks>max_vm_kb*1024){
bc_tester_printf(
bc_printf_verbosity_error,
"The program exceeded the maximum amount of memory allocatable (%i bytes), aborting now.\n",
{"Incoming call accepted when outgoing call in outgoing ringing early media",incoming_call_accepted_when_outgoing_call_in_outgoing_ringing_early_media},