From db2af2abb03a82e7c71581efa04a45869feba38a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 15 Aug 2014 15:42:14 -0400 Subject: Start converting circuitlist to smartlist. --- src/or/circuitlist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/or/circuitlist.c') diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index f3a83503ef..f3518751b1 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -38,8 +38,7 @@ /********* START VARIABLES **********/ /** A global list of all circuits at this hop. */ -struct global_circuitlist_s global_circuitlist = - TOR_LIST_HEAD_INITIALIZER(global_circuitlist); +static smartlist_t *global_circuitlist = NULL; /** A list of all the circuits in CIRCUIT_STATE_CHAN_WAIT. */ static smartlist_t *circuits_pending_chans = NULL; @@ -458,10 +457,12 @@ circuit_close_all_marked(void) } /** Return the head of the global linked list of circuits. */ -MOCK_IMPL(struct global_circuitlist_s *, +MOCK_IMPL(smartlist_t *, circuit_get_global_list,(void)) { - return &global_circuitlist; + if (NULL == global_circuitlist) + global_circuitlist = smartlist_new(); + return global_circuitlist; } /** Function to make circ-\>state human-readable */ -- cgit v1.2.3-54-g00ecf