From owner-freebsd-current Mon Feb 9 13:35:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA28327 for current-outgoing; Mon, 9 Feb 1998 13:35:12 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA28300 for ; Mon, 9 Feb 1998 13:34:56 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by ns1.yes.no (8.8.7/8.8.7) with ESMTP id VAA21691; Mon, 9 Feb 1998 21:34:53 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id WAA12610; Mon, 9 Feb 1998 22:34:52 +0100 (MET) Message-ID: <19980209223452.41056@follo.net> Date: Mon, 9 Feb 1998 22:34:52 +0100 From: Eivind Eklund To: Pierre Beyssac Cc: Eivind Eklund , current@FreeBSD.ORG Subject: Re: Heads up: static -ification References: <19980209064733.56080@follo.net> <19980209210343.OU10756@@> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <19980209210343.OU10756@@>; from Pierre Beyssac on Mon, Feb 09, 1998 at 09:03:44PM +0100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Feb 09, 1998 at 09:03:44PM +0100, Pierre Beyssac wrote: > Eivind Eklund writes: > > I'm just about to commit a change that staticize close to everything that > > can be staticized and doesn't look unreasonable to staticize (almost 400 > > variables and functions). > > Just out of curiosity, what's the rationale for this? Smaller stack > footprint? Faster access to said variables? There are a multitude of reasons; I'll list some of them: * The namespace was badly managed. E.g, a single driver had taken the global name 'devfs_token'. * Localization of state - to allow the programmer to see that his changes don't affect anything beyond that file. * Localization of state - to let the compiler do better optimizing. * Detection of unused variables. * Data hiding - this make better module boundaries, and make more certain that incestous relationships don't develop. It will make it easier to change the code later. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe current" in the body of the message