summaryrefslogtreecommitdiff
path: root/rts/RetainerSet.h
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-06-20 20:13:45 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-09-22 15:18:10 +0200
commitf3bb73973284b6d60795b63049af5716ab081b34 (patch)
treef79be23a942d3ec05703105b70b9074664d15f08 /rts/RetainerSet.h
parentb92ed68a7c452685e21debec947b11520e70f8da (diff)
downloadhaskell-f3bb73973284b6d60795b63049af5716ab081b34.tar.gz
rts: RetainerSet: Remove obsolete fist/second-approach choice
In the old code when DEBUG_RETAINER was set, FIRST_APPROACH is implied. However ProfHeap.c now depends on printRetainerSetShort which is only available with SECOND_APPROACH. This is because with FIRST_APPROACH retainerProfile() will free all retainer sets before returning so by the time ProfHeap calls dumpCensus the retainer set pointers are segfaulty. Since all of this debugging code obviously hasn't been compiled in ages anyways I'm taking the liberty of just removing it. Remember guys: Dead code is a liability not an asset :)
Diffstat (limited to 'rts/RetainerSet.h')
-rw-r--r--rts/RetainerSet.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/rts/RetainerSet.h b/rts/RetainerSet.h
index 44ec519c68..aa5f44beaa 100644
--- a/rts/RetainerSet.h
+++ b/rts/RetainerSet.h
@@ -52,31 +52,10 @@ typedef struct _RetainerSet {
// do not put anything below here!
} RetainerSet;
-/*
- Note:
- There are two ways of maintaining all retainer sets. The first is simply by
- freeing all the retainer sets and re-initialize the hash table at each
- retainer profiling. The second is by setting the cost field of each
- retainer set. The second is preferred to the first if most retainer sets
- are likely to be observed again during the next retainer profiling. Note
- that in the first approach, we do not free the memory allocated for
- retainer sets; we just invalidate all retainer sets.
- */
-#if defined(DEBUG_RETAINER)
-// In thise case, FIRST_APPROACH must be turned on because the memory pool
-// for retainer sets is freed each time.
-#define FIRST_APPROACH
-#else
-// #define FIRST_APPROACH
-#define SECOND_APPROACH
-#endif
// Creates the first pool and initializes a hash table. Frees all pools if any.
void initializeAllRetainerSet(void);
-// Refreshes all pools for reuse and initializes a hash table.
-void refreshAllRetainerSet(void);
-
// Frees all pools.
void closeAllRetainerSet(void);
@@ -138,25 +117,21 @@ isMember(retainer r, RetainerSet *rs)
// Finds or creates a retainer set augmented with a new retainer.
RetainerSet *addElement(retainer, RetainerSet *);
-#if defined(SECOND_APPROACH)
// Prints a single retainer set.
void printRetainerSetShort(FILE *, RetainerSet *, W_, uint32_t);
-#endif
// Print the statistics on all the retainer sets.
// store the sum of all costs and the number of all retainer sets.
void outputRetainerSet(FILE *, uint32_t *, uint32_t *);
-#if defined(SECOND_APPROACH)
// Print all retainer sets at the exit of the program.
void outputAllRetainerSet(FILE *);
-#endif
// Hashing functions
/*
Invariants:
- Once either initializeAllRetainerSet() or refreshAllRetainerSet()
- is called, there exists only one copy of any retainer set created
+ Once initializeAllRetainerSet() is called,
+ there exists only one copy of any retainer set created
through singleton() and addElement(). The pool (the storage for
retainer sets) is consumed linearly. All the retainer sets of the
same hash function value are linked together from an element in