|
@@ -122,7 +122,7 @@ chunk_repack(chunk_t *chunk)
|
|
|
}
|
|
|
|
|
|
/** Keep track of total size of allocated chunks for consistency asserts */
|
|
|
-static size_t total_bytes_allocated_in_chunks = 0;
|
|
|
+//static size_t total_bytes_allocated_in_chunks = 0;
|
|
|
static void
|
|
|
buf_chunk_free_unchecked(chunk_t *chunk)
|
|
|
{
|
|
@@ -131,9 +131,9 @@ buf_chunk_free_unchecked(chunk_t *chunk)
|
|
|
#ifdef DEBUG_CHUNK_ALLOC
|
|
|
tor_assert(CHUNK_ALLOC_SIZE(chunk->memlen) == chunk->DBG_alloc);
|
|
|
#endif
|
|
|
- tor_assert(total_bytes_allocated_in_chunks >=
|
|
|
- CHUNK_ALLOC_SIZE(chunk->memlen));
|
|
|
- total_bytes_allocated_in_chunks -= CHUNK_ALLOC_SIZE(chunk->memlen);
|
|
|
+ //tor_assert(total_bytes_allocated_in_chunks >=
|
|
|
+ // CHUNK_ALLOC_SIZE(chunk->memlen));
|
|
|
+ //total_bytes_allocated_in_chunks -= CHUNK_ALLOC_SIZE(chunk->memlen);
|
|
|
tor_free(chunk);
|
|
|
}
|
|
|
static inline chunk_t *
|
|
@@ -147,7 +147,7 @@ chunk_new_with_alloc_size(size_t alloc)
|
|
|
ch->DBG_alloc = alloc;
|
|
|
#endif
|
|
|
ch->memlen = CHUNK_SIZE_WITH_ALLOC(alloc);
|
|
|
- total_bytes_allocated_in_chunks += alloc;
|
|
|
+ //total_bytes_allocated_in_chunks += alloc;
|
|
|
ch->data = &ch->mem[0];
|
|
|
CHUNK_SET_SENTINEL(ch, alloc);
|
|
|
return ch;
|
|
@@ -171,7 +171,7 @@ chunk_grow(chunk_t *chunk, size_t sz)
|
|
|
tor_assert(chunk->DBG_alloc == orig_alloc);
|
|
|
chunk->DBG_alloc = new_alloc;
|
|
|
#endif
|
|
|
- total_bytes_allocated_in_chunks += new_alloc - orig_alloc;
|
|
|
+ //total_bytes_allocated_in_chunks += new_alloc - orig_alloc;
|
|
|
CHUNK_SET_SENTINEL(chunk, new_alloc);
|
|
|
return chunk;
|
|
|
}
|
|
@@ -434,7 +434,7 @@ static chunk_t *
|
|
|
chunk_copy(const chunk_t *in_chunk)
|
|
|
{
|
|
|
chunk_t *newch = tor_memdup(in_chunk, CHUNK_ALLOC_SIZE(in_chunk->memlen));
|
|
|
- total_bytes_allocated_in_chunks += CHUNK_ALLOC_SIZE(in_chunk->memlen);
|
|
|
+ //total_bytes_allocated_in_chunks += CHUNK_ALLOC_SIZE(in_chunk->memlen);
|
|
|
#ifdef DEBUG_CHUNK_ALLOC
|
|
|
newch->DBG_alloc = CHUNK_ALLOC_SIZE(in_chunk->memlen);
|
|
|
#endif
|
|
@@ -510,11 +510,11 @@ buf_get_oldest_chunk_timestamp(const buf_t *buf, uint32_t now)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-size_t
|
|
|
-buf_get_total_allocation(void)
|
|
|
-{
|
|
|
- return total_bytes_allocated_in_chunks;
|
|
|
-}
|
|
|
+//size_t
|
|
|
+//buf_get_total_allocation(void)
|
|
|
+//{
|
|
|
+// return total_bytes_allocated_in_chunks;
|
|
|
+//}
|
|
|
|
|
|
/** Append <b>string_len</b> bytes from <b>string</b> to the end of
|
|
|
* <b>buf</b>.
|