Skip to content

Commit

Permalink
Free romToRam hash table and mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Theresa Mammarella <[email protected]>
  • Loading branch information
theresa-m committed Sep 23, 2024
1 parent 02cb848 commit 5711e61
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions runtime/shared_common/shrinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4283,8 +4283,6 @@ j9shr_shutdown(J9JavaVM *vm)
J9SharedStringFarm* jclStringFarm = config->jclStringFarm;
J9HashTable* urlHashTable = config->jclURLHashTable;
J9HashTable* utfHashTable = config->jclUTF8HashTable;
J9HashTable *romToRamHashTable = config->romToRamHashTable;
omrthread_rwmutex_t romToRamHashTableMutex = config->romToRamHashTableMutex;
J9VMThread* currentThread = vm->internalVMFunctions->currentVMThread(vm);

/* Free all of the cached ClasspathItems */
Expand All @@ -4303,6 +4301,15 @@ j9shr_shutdown(J9JavaVM *vm)
if (config->jclCacheMutex) {
omrthread_monitor_destroy(config->jclCacheMutex);
}

if (config->romToRamHashTableMutex) {
omrthread_rwmutex_destroy(config->romToRamHashTableMutex);
}

if (config->romToRamHashTable) {
hashTableFree(config->romToRamHashTable);
}

j9mem_free_memory(config->sharedAPIObject);
j9mem_free_memory(config);

Expand All @@ -4329,16 +4336,6 @@ j9shr_shutdown(J9JavaVM *vm)
if (utfHashTable) {
hashTableFree(utfHashTable);
}
if (NULL != romToRamHashTable) {
omrthread_rwmutex_enter_write(romToRamHashTableMutex);
config->romToRamHashTable = NULL;
config->romToRamHashTableMutex = NULL;
if (romToRamHashTable) {
hashTableFree(romToRamHashTable);
}
omrthread_rwmutex_exit_write(romToRamHashTableMutex);
omrthread_rwmutex_destroy(romToRamHashTableMutex);
}

/* Kill the string farm */

Expand Down

0 comments on commit 5711e61

Please sign in to comment.