summaryrefslogtreecommitdiffstats
path: root/dhash
Commit message (Collapse)AuthorAgeFilesLines
* DHASH: minor fixesOndrej Kos2013-04-101-1/+3
| | | | | | | | https://fedorahosted.org/sssd/ticket/1877 fix coverity issue 11620 fix compilation warning (missing HI_STATE_0 in switch)
* DHASH: Don't use backward jumpsOndrej Kos2013-04-051-23/+56
| | | | https://fedorahosted.org/sssd/ticket/1855
* DHASH: Check before dereferencingOndrej Kos2013-04-041-3/+6
| | | | https://fedorahosted.org/sssd/ticket/1858
* Replacing sprintf with snprintfDmitri Pal2013-01-241-5/+6
| | | | | | | | Replaced sprintf in the unit test. Defined constants for sizes and used them. Wrpapped lines where noticed that they are longer than 80. Added comments to the places where sprintf is still used but it is safe to use.
* Fixing headersDmitri Pal2013-01-241-0/+1
| | | | | | | Move GNU_SOUCE definition to configure.ac Change all headers to use config.h. Move config.h to the top. Remove errno.h if it is not needed.
* Make CLANG happyDmitri Pal2013-01-041-2/+7
| | | | Address CLANG issues in the main code.
* Ensure error_string() never returns NULLSumit Bose2012-04-251-1/+12
| | | | | | A Coverity check indicated that ther are platforms where strerror() will return NULL for unknown, e.g. negative error numbers. Chances are that these platforms will have problems with NULL arguments to printf() too.
* * Resolves: bug #735464 Fix the loop limit used to initialize the table ↵John Dennis2012-04-253-77/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory, was based on count, now limited to segment_count. * Do not pre-allocate all buckets based on requested table size. This defeats the point of a dynamic hash table which adjusts it's memory usage depending upon the number of items it holds. Pre-allocation also runs afoul of the table contraction logic, if the table is pre-allocated to a large size it will subsequently try to compact it negating the pre-allocation. Now the initial allocation is restricted to one directory segment (i.e. table->segment_count == 1) * If the caller did not specify the directory_bits and segment_bits then compute them from the requested table size. The directory_size and segment_size must be powers of 2 to accmodate fast arithmetic. An optimal maximum number of buckets would be equal to the anticipated table size. If there were no collisions that would mean each item would be located in it's own bucket whose chain length is 1, the item would be immediatly found upon indexing into the bucket table. * There is a requirment there be at least one directory segment, however contract_table() failed to enforce this requirement. Add a check to enforce the requirement. * If hash_create() or hash_create_ex() failed it left the tbl parameter uninitialized but returned an error code. Now upon failure tbl is initialized to NULL as well as returning an error code. * Clean up how the directory and segment sizes were computed. It had been using a loop and shifting 1 bit at a time, now it shifts all the bits in one operation and assures at least one directory and segment are allocated. * In the event of an early exit from hash_create_ex() due to an error make sure all previously allocated resources are cleaned up by calling hash_destroy(). There was only one place this was missing. hash_destroy() blindly assumed the table had a directory, normally it would unless hash_destroy was called due to an early exit in hash_create_ex(). Modify hash_destroy() to check for the existence of the directory before cleaning up the directory contents. * Update the function documentation in dhash.h to explain each parameter of hash_create() and hash_create_ex(). * Enhance dhash_test.c - To output the random seed used to intialize the random number generator and add command line option to set the random seed. This permits recreating a failed test run. - Add command line parameter to set the initial table size. - Use proper string to long conversion routines when reading command line parameters (e.g. strtoul() instead of atoi()) - Add logic to make sure each test value is unique. * Add additional information to the debug output to show the computed directory_bits, segment_bits, sizes, etc. * Adjust the debug_level conditionals to be less verbose.
* Fix a typo in dhash.hSumit Bose2010-10-211-1/+1
|
* dhash: Allow hash_enter() to update entriesSumit Bose2010-10-122-27/+99
|
* dhash: Fix memory leak in exampleSumit Bose2010-10-121-0/+3
|
* dhash: add stddef.h to dhash.hSumit Bose2010-10-121-0/+1
| | | | | size_t is used in dhash.h and was currently not defined by any included header file.
* Fix version handling of the librariesSumit Bose2010-09-231-2/+2
|
* Build all of the ding-libs from the rootding_libs-0_1_0Stephen Gallagher2010-09-227-1019/+0
| | | | | This changes our approach from having independent tarballs to having a single, monolithic tarball for all of the libraries
* dhash: Add targets for RPM buildStephen Gallagher2010-08-183-2/+116
|
* Update dhash versionStephen Gallagher2010-08-131-1/+1
|
* Support docdir and abs_builddirStephen Gallagher2010-04-121-0/+6
| | | | | | | | Old versions of autoconf (before 2.60) did not include support for the docdir and abs_builddir variables. This patch emulates support for them. Fixes https://fedorahosted.org/sssd/ticket/422
* Properly license libdhashStephen Gallagher2010-02-184-0/+88
|
* Split off libdhash into a shared libraryStephen Gallagher2010-01-205-9/+16
| | | | | | | | Right now, the pkg-config checks for the system version of libdhash are forcibly disabled, requiring the SSSD to build it from its own tree. In the future, when we split the libraries off from the SSSD, it will be easy to switch this check to the external library.
* License libdhash under the LGPLStephen Gallagher2010-01-203-0/+844
|
* Add comments to document latest changesSimo Sorce2009-12-081-0/+7
|
* dhash: Add private pointer for delete callbackSimo Sorce2009-12-084-13/+35
| | | | | Also pass a flag to the delete callback to tell it if this is a normal entry removal or we are cleaning up the tbale definitively.
* Run dhash testsStephen Gallagher2009-12-081-0/+2
| | | | Previously we were only building them but not running them.
* Change dhash API to be talloc-friendlySimo Sorce2009-12-083-39/+78
|
* Clean up warnings in dhash testsStephen Gallagher2009-10-292-9/+9
|
* Include m4 directories in tarballStephen Gallagher2009-09-151-1/+3
| | | | Necessary for RPM builds on RHEL5
* Add 'make tests' targetStephen Gallagher2009-09-111-0/+2
|
* Build all SSSD components with warnings enabledStephen Gallagher2009-07-132-1/+9
| | | | | | Previously, only the SSSD server components were being built with compile-time warnings enabled. This patch will ensure that all components in common and sss_client are also built the same way.
* Clean up warnings in common/Simo Sorce2009-07-031-1/+1
| | | | Fix consts and function declarations
* Enable quiet build for automake >= 1.11Stephen Gallagher2009-06-021-0/+3
| | | | | | | | | If automake 1.11 or higher is available, use of the configure option '--enable-silent-rules' will suppress most build messages and replace them with lines such as CC sysdb.o This affects libtool as well.
* Clean up automake build to work on older versions of libtoolStephen Gallagher2009-05-261-5/+6
| | | | | | | | | | | | | | LT_INIT is supported only on Libtool >= 2.0, so I reverted it to using AC_PROG_LIBTOOL. Also reorganized how the common libraries were being built. Now they are treated as libtool convenience libraries instead of installable libraries (the --with-singlelib configure flag can still be used to generate a combined, installable DSO) I cleaned up the set of files being installed by automake, so the list of things we need to remove before packaging the RPM is now only the .la files associated with our own plugins.
* more autotools cleanupSumit Bose2009-05-261-1/+1
|
* Fix RPM generation issues with sssdStephen Gallagher2009-05-191-2/+2
| | | | | | | | | | | Ensures that the common libraries build statically. Also ensures that the sssd.spec creates the SYSV init script with the appropriate permissions. Cleans up the useless rpmdist target that was obsolete. Adds the *.so.N.0.0 files to the RPM, as the .so and .so.N files were dangling symlinks.
* Enable parallel builds for the common librariesStephen Gallagher2009-05-191-1/+1
|
* Enable modular build of common SSSD librariesStephen Gallagher2009-05-144-1/+22
| | | | | | Allow configuration and build of individual SSSD utility libraries from their own subdirectories. Building all utilities is still possible recursively from the common root.
* add dynamic hash table data structure implementationJohn Dennis2009-04-226-0/+1897
Apply suggested fixes by Simo after code review * return statements no longer use () unless it's an expression * remove all use of assert() in library * use bool,true,false instead of int,TRUE,FALSE * add check for NULL hash table in public entry points * example code in header file now a seperate file * assure consistent use of unsigned long data type * add more debugging support * break out generation of integer key into convert_key() function * table parameters now tunable rather than hardcoded * table can now accept custom alloc()/free() functions * add function create_table_ex() to pass extra table parameters * remove MUL(), DIV(), MOD() macros * hash statistics now separate struct which can be queried * test program now accepts tuning parameters, iteration count; has better error checking and reporting fix min/max load factor comman line args in test program