From owner-cvs-sys Wed Nov 8 12:02:41 1995 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA17031 for cvs-sys-outgoing; Wed, 8 Nov 1995 12:02:41 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA17024 ; Wed, 8 Nov 1995 12:02:32 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id GAA07042; Thu, 9 Nov 1995 06:59:41 +1100 Date: Thu, 9 Nov 1995 06:59:41 +1100 From: Bruce Evans Message-Id: <199511081959.GAA07042@godzilla.zeta.org.au> To: bde@zeta.org.au, phk@critter.tfs.com Subject: Re: cvs commit: src/sys/kern kern_sysctl.c Cc: CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Sender: owner-cvs-sys@FreeBSD.org Precedence: bulk >> Linker sets are very old technology. They are useful for static linking >> and configuration, but we're trying to get away from those. Consider an >>... >Well, how would you dynamically add something to a switch() {} ? Not :-). The switches would have to be replaced by a table lookup. >> think it is better for the primitive operations to be addition and >> removal operations on a tree. The `sysctl_' linker set would just >> give a list of things to be added to the tree initially. >no, wastes too much storage. Been down that road once. You end up >having to store the entire name in each entry. Bad for your RAM. Can't the tree contain only node pointers and pointers to static info? The node pointers could replace a lot of code in switches but you won't see benefits like that without rewriting more. I'm surprised that you found a lot of storage wasted. I would have thought that there aren't enough sysctl variables to matter. There aren't many because they were too hard to add :-). Bruce