Skip to content

Commit

Permalink
rts: drop unused 'traverseAllRetainerSet'
Browse files Browse the repository at this point in the history
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@google.com>
  • Loading branch information
trofi committed Feb 7, 2016
1 parent 7a48865 commit a49c9d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
2 changes: 0 additions & 2 deletions docs/storage-mgt/rp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,6 @@ \subsection{Retainer sets and the cost function}
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@.
\item[@void traverseAllRetainerSet(void (*f)(retainerSet *))@] invokes the function
@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
Expand Down
22 changes: 3 additions & 19 deletions rts/RetainerSet.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,43 +214,27 @@ addElement(retainer r, RetainerSet *rs)
return nrs;
}

/* -----------------------------------------------------------------------------
* 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);
Expand Down
8 changes: 0 additions & 8 deletions rts/RetainerSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit a49c9d4

Please sign in to comment.