summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorCrazycolorz5 <Crazycolorz5@gmail.com>2019-01-20 19:26:58 -0500
committerBen Gamari <ben@well-typed.com>2019-11-17 07:31:49 -0500
commitb109cb0efdbf62c264a45f0faeb18ff904cc5745 (patch)
tree0431dc52214aa5a179ebb551f4757169f5c409e0 /rts/Linker.c
parent2f5ed225b78b32c65d023072d78ae5d176e2f04b (diff)
downloadhaskell-wip/D4889.tar.gz
rts: Specialize hashing at call site rather than in struct.wip/D4889
Separate word and string hash tables on the type level, and do not store the hashing function. Thus when a different hash function is desire it is provided upon accessing the table. This is worst case the same as before the change, and in the majority of cases is better. Also mark the functions for aggressive inlining to improve performance. {F1686506} Reviewers: bgamari, erikd, simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #13165 Differential Revision: https://phabricator.haskell.org/D4889
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 7bd2e67278..3539f90584 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -158,7 +158,7 @@
2) The number of duplicate symbols, since now only symbols that are
true duplicates will display the error.
*/
-/*Str*/HashTable *symhash;
+StrHashTable *symhash;
/* List of currently loaded objects */
ObjectCode *objects = NULL; /* initially empty */
@@ -227,7 +227,7 @@ int ocTryLoad( ObjectCode* oc );
static void *mmap_32bit_base = (void *)MMAP_32BIT_BASE_DEFAULT;
-static void ghciRemoveSymbolTable(HashTable *table, const SymbolName* key,
+static void ghciRemoveSymbolTable(StrHashTable *table, const SymbolName* key,
ObjectCode *owner)
{
RtsSymbolInfo *pinfo = lookupStrHashTable(table, key);
@@ -262,7 +262,7 @@ static void ghciRemoveSymbolTable(HashTable *table, const SymbolName* key,
*/
int ghciInsertSymbolTable(
pathchar* obj_name,
- HashTable *table,
+ StrHashTable *table,
const SymbolName* key,
SymbolAddr* data,
HsBool weak,
@@ -373,7 +373,7 @@ int ghciInsertSymbolTable(
* Returns: 0 on failure and result is not set,
* nonzero on success and result set to nonzero pointer
*/
-HsBool ghciLookupSymbolInfo(HashTable *table,
+HsBool ghciLookupSymbolInfo(StrHashTable *table,
const SymbolName* key, RtsSymbolInfo **result)
{
RtsSymbolInfo *pinfo = lookupStrHashTable(table, key);
@@ -524,7 +524,7 @@ exitLinker( void ) {
}
#endif
if (linker_init_done == 1) {
- freeHashTable(symhash, free);
+ freeStrHashTable(symhash, free);
}
#if defined(THREADED_RTS)
closeMutex(&linker_mutex);
@@ -1200,7 +1200,7 @@ void freeObjectCode (ObjectCode *oc)
}
if (oc->extraInfos != NULL) {
- freeHashTable(oc->extraInfos, NULL);
+ freeStrHashTable(oc->extraInfos, NULL);
oc->extraInfos = NULL;
}