Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#27224: Conserve memory allocations #293

Closed
wants to merge 8 commits into from

Conversation

Labels
None yet
Projects
None yet
3 participants
@rl1987
Copy link
Contributor

@rl1987 rl1987 commented Aug 26, 2018

https://trac.torproject.org/projects/tor/ticket/27224

rl1987 added 7 commits Aug 26, 2018
All node_get_all_orports() does is allocate and return a smartlist
with at most two tor_addr_port_t members that match ORPort's of
node configuration. This is harmful for memory efficiency, as it
allocates the same stuff every time it is called. However,
node_is_a_configured_bridge() does not need to call it, as it
already has all the information to check if there is configured
bridge for a given node.

The new code is arranged in a way that hopefully makes each succeeding
linear search through bridge_list less likely.
@coveralls
Copy link

@coveralls coveralls commented Aug 27, 2018

Coverage Status

Coverage decreased (-0.005%) to 59.531% when pulling 2e14219 on rl1987:bug27224_take2 into 2e54c80 on torproject:master.

@nmathewson
Copy link
Contributor

@nmathewson nmathewson commented Sep 13, 2018

(squashed and merged)

@nmathewson nmathewson closed this Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment