# HG changeset patch # User Me # Date 1288581930 25200 # Node ID 1ee1005644083e0ccfe56bc64ed0c13ea5a93dbc # Parent e6fe47763ee6a98f6bfc5b9188dbc36f99fe84c7 Changed malloc and free to VMS__malloc and VMS__free diff -r e6fe47763ee6 -r 1ee100564408 PrivateHash.c --- a/PrivateHash.c Sat Sep 11 07:57:41 2010 -0700 +++ b/PrivateHash.c Sun Oct 31 20:25:30 2010 -0700 @@ -18,11 +18,11 @@ HashTable * makeHashTable( int numHashSlots, FreeEntryContentFnPtr freeFn ) { HashTable * retTable; - retTable = malloc( sizeof( HashTable ) ); + retTable = VMS__malloc( sizeof( HashTable ) ); retTable->freeEntryContentFn = freeFn; - retTable->entries = malloc( numHashSlots * sizeof(HashEntry *) ); + retTable->entries = VMS__malloc( numHashSlots * sizeof(HashEntry *) ); retTable->numEntries = 0; retTable->tableSz = numHashSlots; @@ -40,7 +40,7 @@ oldEntries = table->entries; newTableSz = 2 * oldTableSz + 1; - newEntries = malloc( newTableSz * sizeof(HashEntry *) ); + newEntries = VMS__malloc( newTableSz * sizeof(HashEntry *) ); table->tableSz = newTableSz; table->entries = newEntries; @@ -112,7 +112,7 @@ hashEntry = getEntryFromTable( key, table ); if( hashEntry == NULL ) { hashIdx = hashThisKey( key, table->tableSz ); - hashEntry = (HashEntry*) malloc( sizeof( HashEntry ) ); + hashEntry = (HashEntry*) VMS__malloc( sizeof( HashEntry ) ); if( hashEntry == NULL ) return 0; hashEntry->key = strdup( key ); //TODO: figure out soln for incr Sz if( hashEntry->key == NULL ) return 0; @@ -232,14 +232,14 @@ { if( entry->content != NULL ) (*(table->freeEntryContentFn))( entry->content ); - free( entry->key ); //was malloc'd above, so free it - free( entry ); + VMS__free( entry->key ); //was VMS__malloc'd above, so free it + VMS__free( entry ); } void freeHashEntryButNotContent( HashEntry *entry ) { - free( entry->key ); //was malloc'd above, so free it - free( entry ); + VMS__free( entry->key ); //was VMS__malloc'd above, so free it + VMS__free( entry ); }