SYNOPSIS

When \s-1XPA\s0 can't allocate memory, it exits. You can arrange to have it call longjmp() instead.

DESCRIPTION

When an \s-1XPA\s0 server or client cannot allocate memory, it will attempt to output an error message and then exit. If this is not satisfactory (e.g., perhaps your program is interactive and can recover from \s-1OOM\s0 errors), you can tell \s-1XPA\s0 to call longjmp() to go to a recovery branch. To pass the requisite jmp_buf variable to \s-1XPA\s0, make the following call:

  XPASaveJmp(void *env);

The value of env is the address of a jmp_buf variable that was previously passed to setjmp(). For example:

jmp_buf env; ... if( setjmp(jmp_buf) != 0 ){ /* out of memory -- take corrective action, if possible */ } else { /* save env for XPA */ XPASaveJmp((void *)&jmp_buf); } // enter main loop ...

RELATED TO xpaoom…

See xpa(7) for a list of \s-1XPA\s0 help pages