[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.3.3] Use STATIC for compute_real_max_mem_in_queues



commit 5633a633796ca10e2866ff6fd5bc40b5f7895c30
Author: Alexander Færøy <ahf@xxxxxxxxxxxxxx>
Date:   Tue Apr 3 17:44:42 2018 +0200

    Use STATIC for compute_real_max_mem_in_queues
    
    This patch makes compute_real_max_mem_in_queues use the STATIC macro,
    which allows us to test the function.
    
    See: https://bugs.torproject.org/24782
---
 src/or/config.c | 4 +---
 src/or/config.h | 4 ++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index cec14e0f5..1f8ff5e3a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -773,8 +773,6 @@ static void config_maybe_load_geoip_files_(const or_options_t *options,
 static int options_validate_cb(void *old_options, void *options,
                                void *default_options,
                                int from_setconf, char **msg);
-static uint64_t compute_real_max_mem_in_queues(const uint64_t val,
-                                               int log_guess);
 static void cleanup_protocol_warning_severity_level(void);
 static void set_protocol_warning_severity_level(int warning_severity);
 
@@ -4522,7 +4520,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
 /* Given the value that the user has set for MaxMemInQueues, compute the
  * actual maximum value.  We clip this value if it's too low, and autodetect
  * it if it's set to 0. */
-static uint64_t
+STATIC uint64_t
 compute_real_max_mem_in_queues(const uint64_t val, int log_guess)
 {
   uint64_t result;
diff --git a/src/or/config.h b/src/or/config.h
index 2f23809b2..f6a659d0c 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -258,6 +258,10 @@ STATIC int parse_port_config(smartlist_t *out,
                   const unsigned flags);
 
 STATIC int check_bridge_distribution_setting(const char *bd);
+
+STATIC uint64_t compute_real_max_mem_in_queues(const uint64_t val,
+                                               int log_guess);
+
 #endif /* defined(CONFIG_PRIVATE) */
 
 #endif /* !defined(TOR_CONFIG_H) */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits