Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Aug 1998 03:00:01 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/7523: clearly marking gcc extension in swap_pager.c
Message-ID:  <199808081000.DAA22471@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/7523; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, seggers@semyam.dinoco.de
Cc:  Subject: Re: kern/7523: clearly marking gcc extension in swap_pager.c
Date: Sat, 8 Aug 1998 19:58:58 +1000

 >	In a thread in freebsd-hackers John Polstra said that when
 >using gcc extensions they should be #ifdef'ed and have an alternative
 >implementation.  In swap_pager.c this is missing in two functions
 >where arrays with computed size (a gcc extension) are used.
 
 This extension is in the C9x draft, so we will probably be able to
 depend on it by the time we ifdef all gcc-only extensions.
 
 However, I think it shouldn't be used in the kernel, because the kernel
 stack is limited.  Limits on auto array sizes must be known at compile
 time, since runtime checks would be wasteful and recovery from stack
 overflow would be too difficult.  If the limits are known, they can
 just be used to allocate sufficiently large arrays.
 
 I looked at this a year or two ago.  There seemed to be no actual problem
 with stack growth because all the array sizes were small (< 10 ints?).
 
 >	The propper fix is of course to use dynamic memory for these
 >arrays but doing that is much work and error prone as in front of every
 >return statement one has to add a free for it.  Besides this I first
 
 I think dynamic allocation would be too slow here.
 
 Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808081000.DAA22471>