[commit: ghc] master: rts: drop unused 'traverseAllRetainerSet' (a49c9d4)
git at git.haskell.org
git at git.haskell.org
Sun Feb 7 20:28:34 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a49c9d4ef61f4394b63b9a66b804054f03231c76/ghc
>---------------------------------------------------------------
commit a49c9d4ef61f4394b63b9a66b804054f03231c76
Author: Sergei Trofimovich <siarheit at google.com>
Date: Sun Feb 7 17:55:56 2016 +0000
rts: drop unused 'traverseAllRetainerSet'
While at is mark 'printRetainer' as 'static'.
Noticed by uselex.rb:
printRetainer: [R]: exported from:
./rts/dist/build/RetainerSet.p_o
traverseAllRetainerSet: [R]: exported from:
./rts/dist/build/RetainerSet.p_o
Signed-off-by: Sergei Trofimovich <siarheit at google.com>
>---------------------------------------------------------------
a49c9d4ef61f4394b63b9a66b804054f03231c76
docs/storage-mgt/rp.tex | 2 --
rts/RetainerSet.c | 22 +++-------------------
rts/RetainerSet.h | 8 --------
3 files changed, 3 insertions(+), 29 deletions(-)
diff --git a/docs/storage-mgt/rp.tex b/docs/storage-mgt/rp.tex
index 0d841b9..c6de489 100644
--- a/docs/storage-mgt/rp.tex
+++ b/docs/storage-mgt/rp.tex
@@ -510,8 +510,6 @@ set is created. Otherwise, a new retainer set is created.
is created. Otherwise, a new retainer set is created.
\item[@rtsBool isMember(retainer r, retainerSet *rs)@] returns a boolean value
indicating whether @r@ is a member of @rs at .
-\item[@void traverseAllRetainerSet(void (*f)(retainerSet *))@] invokes the function
- at f@ on every retainer set created.
\item[@void printRetainerSetShort(FILE *, retainerSet *)@] prints a single retainer
set.
\item[@void outputRetainerSet(FILE *, nat *allCost, nat *numSet)@] prints all
diff --git a/rts/RetainerSet.c b/rts/RetainerSet.c
index 234532a..4057e2e 100644
--- a/rts/RetainerSet.c
+++ b/rts/RetainerSet.c
@@ -215,42 +215,26 @@ addElement(retainer r, RetainerSet *rs)
}
/* -----------------------------------------------------------------------------
- * Call f() for each retainer set.
- * -------------------------------------------------------------------------- */
-void
-traverseAllRetainerSet(void (*f)(RetainerSet *))
-{
- int i;
- RetainerSet *rs;
-
- (*f)(&rs_MANY);
- for (i = 0; i < HASH_TABLE_SIZE; i++)
- for (rs = hashTable[i]; rs != NULL; rs = rs->link)
- (*f)(rs);
-}
-
-
-/* -----------------------------------------------------------------------------
* printRetainer() prints the full information on a given retainer,
* not a retainer set.
* -------------------------------------------------------------------------- */
#if defined(RETAINER_SCHEME_INFO)
// Retainer scheme 1: retainer = info table
-void
+static void
printRetainer(FILE *f, retainer itbl)
{
fprintf(f, "%s[%s]", GET_PROF_DESC(itbl), itbl->prof.closure_type);
}
#elif defined(RETAINER_SCHEME_CCS)
// Retainer scheme 2: retainer = cost centre stack
-void
+static void
printRetainer(FILE *f, retainer ccs)
{
fprintCCS(f, ccs);
}
#elif defined(RETAINER_SCHEME_CC)
// Retainer scheme 3: retainer = cost centre
-void
+static void
printRetainer(FILE *f, retainer cc)
{
fprintf(f,"%s.%s", cc->module, cc->label);
diff --git a/rts/RetainerSet.h b/rts/RetainerSet.h
index 086629d..ea9fabb 100644
--- a/rts/RetainerSet.h
+++ b/rts/RetainerSet.h
@@ -160,9 +160,6 @@ isMember(retainer r, RetainerSet *rs)
// Finds or creates a retainer set augmented with a new retainer.
RetainerSet *addElement(retainer, RetainerSet *);
-// Call f() for each retainer set.
-void traverseAllRetainerSet(void (*f)(RetainerSet *));
-
#ifdef SECOND_APPROACH
// Prints a single retainer set.
void printRetainerSetShort(FILE *, RetainerSet *, nat);
@@ -194,11 +191,6 @@ void outputAllRetainerSet(FILE *);
#define hashKeySingleton(r) ((StgWord)(r))
#define hashKeyAddElement(r, s) (hashKeySingleton((r)) + (s)->hashKey)
-// Prints the full information on a given retainer.
-// Note: This function is not part of retainerSet interface, but this is
-// the best place to define it.
-void printRetainer(FILE *, retainer);
-
#include "EndPrivate.h"
#endif /* PROFILING */
More information about the ghc-commits
mailing list