views:

2365

answers:

9

Do you know a good and free Hashtable imlementation for Delphi 5 ?

I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web.

Tks

+2  A: 
zaca
We have tried the implementation provided by benya.com but we ran into some memory leak issues. Have you tried the second one ?Tnks for the answer
Gustavo
No. I use TList,TStringList or TClientDataSet + BinarySearch in case of huge amount of data.
zaca
+1  A: 

You can Try to search in Koders.
Here you have a simple implementation (Winjab project), or this from JCL.

NOTE: See the licence of codes before use it.

Neftalí
+3  A: 

EZDSL is a library of data structures, including a hash table, written by Julian Bucknall of TurboPower and DevExpress... I haven't used them, but I would have high expectations for this guy's code.

http://www.boyet.com/FixedArticles/EZDSL.html

+3  A: 

You can try my GpStringHash. Guaranteed no memory leaks, but works only with strings. I think it should work in D5.

gabr
+5  A: 

You can also check out the open-source / formerly commercial TurboPower SysTools. Not sure how much it is being updated. At one point Julian Bucknall recommended it over his EZDSL library, although that was back when he still worked fur TurboPower and it was being maintained / updated.

Jim McKeeth
Actually Turbo-Powers LockBox is probably what he wants, the latest version is updated at http://www.songbeamer.com/delphi/
skamradt
LockBox does cryptographic hashing - SysTools and EZDSL do hashtables, which are a data structure.
Jim McKeeth
A: 

Peter Below just posted a rework of something he did to the Embarcadero newgroups in the public.attachments. There's something under his profile on the CodeGear site at http://cc.codegear.com/Item/24825 taht describes it.

GuyWithDogs
A: 

Checkout DeCAL, which includes hash tables and more data structures.

A: 

Apart from the actual hash-table implementation, the hash-function being used itself is also important.

A good one is a hash function from Bob Jenkins, read his paper here.

This algorithm was improved upon recently for cases where the input is DWord-sized (See the C-version of it here). This version is faster, and results in two 32-bit hash-values instead of one. (This second hash-value could be used to speed up in-bucket selection for example.)

For those interested, I could paste the Delphi-translation here? (It's about 170 lines of code.)

PatrickvL
A: 

RBS Antidot is very good library of containers (including hash-based UnsortedMap).