diff options
author | Roger Dingledine <arma@torproject.org> | 2005-07-18 06:09:04 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-07-18 06:09:04 +0000 |
commit | e8a1b1d6a09b38671efcdb20c317f631f4d2810c (patch) | |
tree | 7308600b9e45e2132a0d149e96d2c9d2e0349942 /src/or/rephist.c | |
parent | e573b3f7db184296093158c28daaeb4b454c6f00 (diff) | |
download | tor-e8a1b1d6a09b38671efcdb20c317f631f4d2810c.tar.gz tor-e8a1b1d6a09b38671efcdb20c317f631f4d2810c.zip |
add a trivial tor-counting variable
svn:r4593
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index d3dbe02811..ea8756a721 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -15,7 +15,8 @@ const char rephist_c_id[] = "$Id$"; static void bw_arrays_init(void); static void predicted_ports_init(void); -uint64_t rephist_total_alloc; +uint64_t rephist_total_alloc=0; +uint32_t rephist_total_num=0; /** History of an OR-\>OR link. */ typedef struct link_history_t { @@ -73,6 +74,7 @@ get_or_history(const char* id) if (!hist) { hist = tor_malloc_zero(sizeof(or_history_t)); rephist_total_alloc += sizeof(or_history_t); + rephist_total_num++; hist->link_history_map = strmap_new(); hist->since = hist->changed = time(NULL); strmap_set(history_map, hexid, hist); @@ -121,6 +123,7 @@ free_or_history(void *_hist) or_history_t *hist = _hist; strmap_free(hist->link_history_map, _free_link_history); rephist_total_alloc -= sizeof(or_history_t); + rephist_total_num--; tor_free(hist); } |