aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmconst.h
AgeCommit message (Collapse)AuthorFiles
2018-01-01Happy GNU YearSergey Poznyakoff1
2017-01-02Happy GNU YearSergey Poznyakoff1
2016-07-15gdbm_open adjusts requested block size to accomodate integer number of ↵Sergey Poznyakoff1
directory offsets. * src/gdbm.h.in (GDBM_BSEXACT): New flag. * src/gdbmopen.c (compute_directory_size): New function. (gdbm_open): When creating new database, adjust the requested block size so that the block holds integer number of directory indices. Disable this behavior if GDBM_BSEXACT flag is set (this reverts to old behavior). Always unset GDBM_BSEXACT if using block size returned by stat(2). This makes sure gdbm_open succeeds on file systems reporting block sizes not divisible by 512. * src/gdbmconst.h (GDBM_MIN_BLOCK_SIZE): New constant. * src/gdbmimp.c (gdbm_import_from_file): Use GDBM_MIN_BLOCK_SIZE instead of the hardcoded value. * NEWS: Document GDBM_BSEXACT. * doc/gdbm.texi: Likewise.
2016-07-14Don't use hardcoded constantSergey Poznyakoff1
* src/gdbmconst.h (GDBM_HASH_BITS): New constant. * src/bucket.c: Use GDBM_HASH_BITS instead of the hardcoded value. * src/findkey.c (_gdbm_findkey): Use _gdbm_hash_key. * src/gdbmtool.c (hash_handler): Use _gdbm_hash_key if the database is open. * src/hash.c (_gdbm_bucket_dir, _gdbm_hash_key): New functions. * src/proto.h (_gdbm_bucket_dir, _gdbm_hash_key): New protos. * src/systems.h (STATBLKSIZE): Take a struct stat as argument. * src/gdbmopen.c (STATBLKSIZE): Takes argument now.
2013-12-25Version 1.11Sergey Poznyakoff1
2011-08-13Verify preprocessor directives. Pass them through cppi toSergey Poznyakoff1
reflect their nesting level.
2011-08-10Improve gdbm_setopt interface.Sergey Poznyakoff1
* src/gdbm.h.in (GDBM_OPENMASK): New constant. * src/gdbmconst.h: Remove constants duplicated in gdbm.h.in. * src/gdbmdefs.h (gdbm_file_info) <allow_mmap> <mmap_inited>: Replace with a single member: memory_mapping. All callers updated. (GDBM_SETCACHESIZE,GDBM_SETSYNCMODE) (GDBM_SETCENTFREE,GDBM_SETCOALESCEBLKS): New option names. (GDBM_SETMMAP,GDBM_GETMMAP,GDBM_GETFLAGS) (GDBM_GETCACHESIZE,GDBM_GETSYNCMODE,GDBM_GETCENTFREE) (GDBM_GETCOALESCEBLKS,GDBM_GETMAXMAPSIZE): New option codes. * src/gdbmsetopt.c: Implement new options. * doc/gdbm.texinfo: Document new options.
2011-08-10Improve memory mapping support.Sergey Poznyakoff1
The new code is more flexible and performs better when lots of inserts are being made (e.g. when populating the database with new data). * src/gdbm.h.in (GDBM_SETMAXMAPSIZE): New constant. * src/gdbmconst.h (SIZE_T_MAX): New define. * src/gdbmdefs.h (gdbm_file_info) <cache_size>: Change type to size_t. <mmap_inited,mapped_size_max>: New member. <mapped_remap>: Remove. * src/gdbmopen.c: Fix a typo. (gdbm_open): Initialize new members. (_gdbm_init_cache): Second argument is size_t. * src/gdbmsetopt.c (gdbm_setopt): Optval argument is void*. Handle GDBM_SETMAXMAPSIZE. Improve error checking. * src/mmap.c (_GDBM_IN_MAPPED_REGION_P): Fix comparison with the lower bound. (_GDBM_NEED_REMAP): Return true if mapped_region is NULL. (SUM_FILE_SIZE): Rewrite. (_gdbm_mapped_unmap): Don't call msync. (_gdbm_internal_remap): Take 2 arguments, the second one giving the new mapped size. Unmap the region prior to remapping it. Always pass NULL as the argument to mmap. (_gdbm_mapped_remap): Rewrite the logic. Change semantics of the third argument. All uses updated. (_gdbm_mapped_init): Reflect the above changes. (_gdbm_mapped_read,_gdbm_mapped_write): Use mmap_inited to decide whether to use mmap, because mapped_region can be reset to zero by another functions (namely, _gdbm_mapped_lseek). Reset mmap_inited to FALSE, if _gdbm_mapped_remap fails. (_gdbm_mapped_lseek): Rewrite offset computations. Invalidate the mapped region. * src/proto.h (_gdbm_init_cache): Change prototype. * src/update.c (write_header, _gdbm_end_update): Remove checks for dbf->mapped_region. * tests/gtload.c: Implement the -maxmap option (set maximal mapped memory size). * doc/gdbm.texinfo: Document GDBM_SETMAXMAPSIZE.
2011-08-03Update copyright headers.Sergey Poznyakoff1
2008-11-21Initial revisionJason Downs1

Return to:

Send suggestions and report system problems to the System administrator.