diff options
author | jbj <devnull@localhost> | 2002-08-26 18:56:11 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-08-26 18:56:11 +0000 |
commit | 0fae1010f0c9a563ea79a01d82eea80e7e8f7ece (patch) | |
tree | 99425f7ad66da6c54f4bca77f570e78e75db053e /db/env | |
parent | 85a70389f6797877fea23b2d2bfe1c0a8acbce6c (diff) | |
download | rpm-0fae1010f0c9a563ea79a01d82eea80e7e8f7ece.tar.gz rpm-0fae1010f0c9a563ea79a01d82eea80e7e8f7ece.tar.bz2 rpm-0fae1010f0c9a563ea79a01d82eea80e7e8f7ece.zip |
- set cachesize without a dbenv, the default is far too small.
- db: don't return EACCES on db->close w/o environment.
- unify cachesize configuration, with (or without) a dbenv.
- comments regarding unsupported (yet) db-4.1.17 functionality.
CVS patchset: 5674
CVS date: 2002/08/26 18:56:11
Diffstat (limited to 'db/env')
-rw-r--r-- | db/env/db_salloc.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/db/env/db_salloc.c b/db/env/db_salloc.c index 4780107c5..881c63bbd 100644 --- a/db/env/db_salloc.c +++ b/db/env/db_salloc.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996, 1997, 1998, 1999, 2000 + * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: db_salloc.c,v 11.10 2000/12/06 19:55:44 ubell Exp $"; +static const char revid[] = "Id: db_salloc.c,v 11.15 2002/02/22 01:55:53 mjc Exp "; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -59,8 +59,8 @@ __db_shalloc_init(area, size) } /* - * __db_shalloc -- - * Allocate some space from the shared region. + * __db_shalloc_size -- + * Return size of the shared region, including alignment. * * PUBLIC: int __db_shalloc_size __P((size_t, size_t)); */ @@ -81,7 +81,7 @@ __db_shalloc_size(len, align) if (align <= sizeof(db_align_t)) align = sizeof(db_align_t); - return (ALIGN(len, align) + sizeof (struct __data)); + return ((int)(ALIGN(len, align) + sizeof (struct __data))); } /* @@ -284,28 +284,6 @@ __db_shalloc_free(regionp, ptr) } /* - * __db_shalloc_count -- - * Return the amount of memory on the free list. - * - * PUBLIC: size_t __db_shalloc_count __P((void *)); - */ -size_t -__db_shalloc_count(addr) - void *addr; -{ - struct __data *elp; - size_t count; - - count = 0; - for (elp = SH_LIST_FIRST((struct __head *)addr, __data); - elp != NULL; - elp = SH_LIST_NEXT(elp, links, __data)) - count += elp->len; - - return (count); -} - -/* * __db_shsizeof -- * Return the size of a shalloc'd piece of memory. * @@ -355,6 +333,6 @@ __db_shalloc_dump(addr, fp) for (elp = SH_LIST_FIRST((struct __head *)addr, __data); elp != NULL; elp = SH_LIST_NEXT(elp, links, __data)) - fprintf(fp, "%#lx: %lu\t", (u_long)elp, (u_long)elp->len); + fprintf(fp, "%#lx: %lu\t", P_TO_ULONG(elp), (u_long)elp->len); fprintf(fp, "\n"); } |