Permalink
Browse files

Got rid of some unused code and warnings

git-svn-id: http://data-race-test.googlecode.com/svn/trunk@418 93a3164d-3a44-0410-8ae5-4baa038b0729
  • Loading branch information...
1 parent 8883292 commit feb4f2ece247da273c842b6debec21754b560f5b timurrrr committed Aug 11, 2008
Showing with 41 additions and 50 deletions.
  1. +1 −1 hg-memstat/hg_debugonly.h
  2. +0 −8 hg-memstat/hg_main.c
  3. +38 −39 hg-memstat/hg_wordset.c
  4. +2 −2 hg-memstat/hg_wordset.h
@@ -43,4 +43,4 @@
#define tl_debug_assert(a)
#endif
-#endif /* ! __HG_DEBUGONLY_H */
+#endif /* ! __HG_DEBUGONLY_H */
@@ -1293,13 +1293,6 @@ static inline UInt SS_unref(SegmentSet ss, UWord sz) {
return HG_(unrefWS) (univ_ssets, ss, sz);
}
-// recycle a non-singleton SS which has refcount zero.
-static inline void SS_recycle(SegmentSet ss) {
- tl_assert(!SS_is_singleton(ss));
- HG_(recycleWS)(univ_ssets, ss);
-}
-
-
static inline Bool LS_valid (LockSet ls) {
return ls < (1 << N_LOCK_SET_BITS);
}
@@ -3859,7 +3852,6 @@ static SegmentSet do_SS_update ( /*OUT*/Bool* hb_all_p,
UWord sz)
{
SegmentSet newSS;
- Bool oldSS_has_active_segment = False;
if (LIKELY(SS_is_singleton(oldSS))) {
// we don't care if oldSS contains an active segment since oldSS
// is a singleton and we don't want to recycle it.
@@ -489,44 +489,6 @@ void HG_(getPayloadWS) ( /*OUT*/UWord** words, /*OUT*/UWord* nWords,
*words = wv->words;
}
-
-// Increment the refcount of ws by sz.
-void HG_(refWS) ( WordSetU *wsu, WordSet ws, UWord sz)
-{
- WordVec* wv;
- tl_assert(wsu);
- wv = do_ix2vec( wsu, ws );
- tl_assert(wv->size >= 0);
- wv->refcount += sz;
-}
-
-// Decrement the refcount of ws by sz and return the new refcount value.
-UWord HG_(unrefWS) ( WordSetU *wsu, WordSet ws, UWord sz)
-{
- WordVec* wv;
- tl_assert(wsu);
- wv = do_ix2vec( wsu, ws );
- tl_assert(wv->size >= 0);
- tl_assert(wv->refcount >= sz);
- wv->refcount -= sz;
- UInt rc = wv->refcount;
- if (rc == 0)
- HG_(recycleWS)(wsu, ws);
- // wv may not be present already
- return rc;
-}
-
-// Get the current refcount of ws.
-UWord HG_(getRefWS) ( WordSetU *wsu, WordSet ws)
-{
- WordVec* wv;
- tl_assert(wsu);
- wv = do_ix2vec( wsu, ws );
- tl_assert(wv->size >= 0);
- return wv->refcount;
-}
-
-
/*
WordSet Recycling.
Once HG_(recycleWS) is called on a ws,
@@ -543,6 +505,7 @@ UWord HG_(getRefWS) ( WordSetU *wsu, WordSet ws)
- Do not call deleteWV, instead maintain our own free list (?).
- Recycle the slot wsu->ix2vec[ws] (will complicate sanity checking).
*/
+void HG_(recycleWS) ( WordSetU *wsu, WordSet ws);
void HG_(recycleWS) ( WordSetU *wsu, WordSet ws)
{
tl_assert(wsu);
@@ -574,6 +537,42 @@ void HG_(recycleWS) ( WordSetU *wsu, WordSet ws)
wsu->recycle_cache[wsu->recycle_cache_n++] = ws;
}
+// Increment the refcount of ws by sz.
+void HG_(refWS) ( WordSetU *wsu, WordSet ws, UInt sz)
+{
+ WordVec* wv;
+ tl_assert(wsu);
+ wv = do_ix2vec( wsu, ws );
+ tl_assert(wv->size >= 0);
+ wv->refcount += sz;
+}
+
+// Decrement the refcount of ws by sz and return the new refcount value.
+UInt HG_(unrefWS) ( WordSetU *wsu, WordSet ws, UInt sz)
+{
+ WordVec* wv;
+ UInt rc;
+ tl_assert(wsu);
+ wv = do_ix2vec( wsu, ws );
+ tl_assert(wv->size >= 0);
+ tl_assert(wv->refcount >= sz);
+ wv->refcount -= sz;
+ rc = wv->refcount;
+ if (rc == 0)
+ HG_(recycleWS)(wsu, ws);
+ // wv may not be present already
+ return rc;
+}
+
+// Get the current refcount of ws.
+UWord HG_(getRefWS) ( WordSetU *wsu, WordSet ws)
+{
+ WordVec* wv;
+ tl_assert(wsu);
+ wv = do_ix2vec( wsu, ws );
+ tl_assert(wv->size >= 0);
+ return wv->refcount;
+}
Bool HG_(plausibleWS) ( WordSetU* wsu, WordSet ws )
{
@@ -586,7 +585,7 @@ Bool HG_(plausibleWS) ( WordSetU* wsu, WordSet ws )
Bool HG_(saneWS_SLOW) ( WordSetU* wsu, WordSet ws )
{
WordVec* wv;
- UWord i;
+ DEBUG_ONLY(UWord i);
if (wsu == NULL) return False;
if (ws < 0 || ws >= wsu->ix2vec_used)
return False;
@@ -87,8 +87,8 @@ WordSet HG_(isSubsetOf) ( WordSetU*, WordSet, WordSet );
Bool HG_(plausibleWS) ( WordSetU*, WordSet );
Bool HG_(saneWS_SLOW) ( WordSetU*, WordSet );
-void HG_(refWS) ( WordSetU*, WordSet, UWord );
-UWord HG_(unrefWS) ( WordSetU*, WordSet, UWord );
+void HG_(refWS) ( WordSetU*, WordSet, UInt );
+UInt HG_(unrefWS) ( WordSetU*, WordSet, UInt );
UWord HG_(getRefWS) ( WordSetU*, WordSet );

0 comments on commit feb4f2e

Please sign in to comment.