From owner-cvs-usrsbin Sun Jul 7 16:02:51 1996 Return-Path: owner-cvs-usrsbin Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA20289 for cvs-usrsbin-outgoing; Sun, 7 Jul 1996 16:02:51 -0700 (PDT) Received: (from wpaul@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA20275; Sun, 7 Jul 1996 16:02:43 -0700 (PDT) Date: Sun, 7 Jul 1996 16:02:43 -0700 (PDT) From: Bill Paul Message-Id: <199607072302.QAA20275@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-usrsbin Subject: cvs commit: src/usr.sbin/ypserv yp_dblookup.c Sender: owner-cvs-usrsbin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk wpaul 96/07/07 16:02:42 Modified: usr.sbin/ypserv yp_dblookup.c Log: Re-implement the DB handle cache using a circular queue and manage it with the CIRCLEQ macros. This simplifies the code a little, makes it somewhat easier to read, and may be a little faster. (Actually I think the performace is about the same.) Also, in the non DB_CACHE case, save copies of data returned from the database library in a static buffer, just in case we decide to use it after the database has been closed. Technically, the memory that the data pointers refer to belongs to the DB package and we can't count on it being there after the database has been closed -- the DB package frees its buffers. (With DB_CACHE #defined the databases are held open so the buffers remain valid.) I don't think any of the utilities that use the dblookup module have had any problems with this yet, but there's no sense in taking any chances. Revision Changes Path 1.8 +180 -89 src/usr.sbin/ypserv/yp_dblookup.c