Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Hash_impl
comparison PrivateHash.c @ 28:18a72865dd78
marked TODO: doubleTableSize corrupts mem
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 06 Mar 2013 14:35:01 +0100 |
| parents | f0f5da84c4c4 |
| children | bd376656f8ab |
comparison
equal
deleted
inserted
replaced
| 15:974e2567be24 | 16:6bad8794df79 |
|---|---|
| 41 return retTable; | 41 return retTable; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void | 44 void |
| 45 doubleTableSize( HashTable *table ) | 45 doubleTableSize( HashTable *table ) |
| 46 { int i, oldTableSz, newTableSz; | 46 { printf("***This code is broken; program will probably segfault soon***\n"); |
| 47 | |
| 48 int i, oldTableSz, newTableSz; | |
| 47 HashEntry *entry, *nextEntry, **oldEntries, **newEntries; | 49 HashEntry *entry, *nextEntry, **oldEntries, **newEntries; |
| 48 | 50 |
| 49 oldTableSz = table->tableSz; | 51 oldTableSz = table->tableSz; |
| 50 oldEntries = table->entries; | 52 oldEntries = table->entries; |
| 51 | 53 |
| 250 freeHashEntryUsing( hashEntry, table ); | 252 freeHashEntryUsing( hashEntry, table ); |
| 251 hashEntry = temp; | 253 hashEntry = temp; |
| 252 } | 254 } |
| 253 } | 255 } |
| 254 } | 256 } |
| 257 VMS_WL__free( entries ); | |
| 258 VMS_WL__free( table ); | |
| 255 } | 259 } |
| 256 | 260 |
| 257 void | 261 void |
| 258 freeHashEntryUsing( HashEntry *entry, HashTable *table ) | 262 freeHashEntryUsing( HashEntry *entry, HashTable *table ) |
| 259 { | 263 { |
