hash.c (190486) | hash.c (190489) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#if defined(LIBC_SCCS) && !defined(lint) 34static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; 35#endif /* LIBC_SCCS and not lint */ 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#if defined(LIBC_SCCS) && !defined(lint) 34static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; 35#endif /* LIBC_SCCS and not lint */ 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/lib/libc/db/hash/hash.c 190486 2009-03-28 06:05:53Z delphij $"); | 37__FBSDID("$FreeBSD: head/lib/libc/db/hash/hash.c 190489 2009-03-28 06:23:10Z delphij $"); |
38 39#include "namespace.h" 40#include <sys/param.h> 41#include <sys/stat.h> 42 43#include <errno.h> 44#include <fcntl.h> 45#include <stdio.h> --- 296 unchanged lines hidden (view full) --- 342 * This calls alloc_segs which may run out of memory. Alloc_segs will destroy 343 * the table and set errno, so we just pass the error information along. 344 * 345 * Returns 0 on No Error 346 */ 347static int 348init_htab(HTAB *hashp, int nelem) 349{ | 38 39#include "namespace.h" 40#include <sys/param.h> 41#include <sys/stat.h> 42 43#include <errno.h> 44#include <fcntl.h> 45#include <stdio.h> --- 296 unchanged lines hidden (view full) --- 342 * This calls alloc_segs which may run out of memory. Alloc_segs will destroy 343 * the table and set errno, so we just pass the error information along. 344 * 345 * Returns 0 on No Error 346 */ 347static int 348init_htab(HTAB *hashp, int nelem) 349{ |
350 int nbuckets, nsegs; 351 int l2; | 350 int nbuckets, nsegs, l2; |
352 353 /* 354 * Divide number of elements by the fill factor and determine a 355 * desired number of buckets. Allocate space for the next greater 356 * power of two number of buckets. 357 */ 358 nelem = (nelem - 1) / hashp->FFACTOR + 1; 359 --- 605 unchanged lines hidden --- | 351 352 /* 353 * Divide number of elements by the fill factor and determine a 354 * desired number of buckets. Allocate space for the next greater 355 * power of two number of buckets. 356 */ 357 nelem = (nelem - 1) / hashp->FFACTOR + 1; 358 --- 605 unchanged lines hidden --- |