|
@@ -2488,13 +2488,13 @@ circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint)
|
|
|
}
|
|
|
|
|
|
/** The total number of cells we have allocated. */
|
|
|
-static size_t total_cells_allocated = 0;
|
|
|
+//static size_t total_cells_allocated = 0;
|
|
|
|
|
|
/** Release storage held by <b>cell</b>. */
|
|
|
static inline void
|
|
|
packed_cell_free_unchecked(packed_cell_t *cell)
|
|
|
{
|
|
|
- --total_cells_allocated;
|
|
|
+ //--total_cells_allocated;
|
|
|
tor_free(cell);
|
|
|
}
|
|
|
|
|
@@ -2502,7 +2502,7 @@ packed_cell_free_unchecked(packed_cell_t *cell)
|
|
|
STATIC packed_cell_t *
|
|
|
packed_cell_new(void)
|
|
|
{
|
|
|
- ++total_cells_allocated;
|
|
|
+ //++total_cells_allocated;
|
|
|
return tor_malloc_zero(sizeof(packed_cell_t));
|
|
|
}
|
|
|
|
|
@@ -2530,8 +2530,9 @@ dump_cell_pool_usage(int severity)
|
|
|
}
|
|
|
SMARTLIST_FOREACH_END(c);
|
|
|
tor_log(severity, LD_MM,
|
|
|
- "%d cells allocated on %d circuits. %d cells leaked.",
|
|
|
- n_cells, n_circs, (int)total_cells_allocated - n_cells);
|
|
|
+ "%d cells allocated on %d circuits.", n_cells, n_circs);
|
|
|
+ // "%d cells allocated on %d circuits. %d cells leaked.",
|
|
|
+ // n_cells, n_circs, (int)total_cells_allocated - n_cells);
|
|
|
}
|
|
|
|
|
|
/** Allocate a new copy of packed <b>cell</b>. */
|
|
@@ -2679,11 +2680,11 @@ packed_cell_mem_cost(void)
|
|
|
}
|
|
|
|
|
|
/* DOCDOC */
|
|
|
-size_t
|
|
|
-cell_queues_get_total_allocation(void)
|
|
|
-{
|
|
|
- return total_cells_allocated * packed_cell_mem_cost();
|
|
|
-}
|
|
|
+//size_t
|
|
|
+//cell_queues_get_total_allocation(void)
|
|
|
+//{
|
|
|
+// return total_cells_allocated * packed_cell_mem_cost();
|
|
|
+//}
|
|
|
|
|
|
/** How long after we've been low on memory should we try to conserve it? */
|
|
|
#define MEMORY_PRESSURE_INTERVAL (30*60)
|
|
@@ -2697,7 +2698,8 @@ STATIC int
|
|
|
cell_queues_check_size(void)
|
|
|
{
|
|
|
time_t now = time(NULL);
|
|
|
- size_t alloc = cell_queues_get_total_allocation();
|
|
|
+ //size_t alloc = cell_queues_get_total_allocation();
|
|
|
+ size_t alloc = 0;
|
|
|
alloc += half_streams_get_total_allocation();
|
|
|
//alloc += buf_get_total_allocation();
|
|
|
alloc += tor_compress_get_total_allocation();
|