Alex Hunsaker wrote:
> On Thu, Jan 7, 2010 at 20:26, Tom Lane <t...@sss.pgh.pa.us> wrote:
> > Alex Hunsaker <bada...@gmail.com> writes:
> 
> > We can either drop this in core (with a lot of #ifdef LINUX added)
> 
> Any thoughts on doing something like (in fork_process.c)
> 
> #ifdef LINUX
> void oom_adjust()
> {
> ...
> }
> #else
> void oom_adjust() {}
> #endif
> 
> So there is only one #ifdef?  It still leaves the ugly calls to the 
> function...

The usual solution for this kind of thing is:

        #ifdef LINUX
        #define OOM_ADJUST oom_adjust()
        #else
        #define OOM_ADJUST do {} while (0)
        #endif

so there is no call or dummy function and you reference it in the code
as:

        OOM_ADJUST;

-- 
  Bruce Momjian  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to