From c3c0a05f51eff73e624b18f651339ed08a122e3d Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 21 Nov 2017 12:28:16 -0500 Subject: Add a new notion of "stamps" to be a fast 32-bit monotonic timestamp The goal here is to replace our use of msec-based timestamps with something less precise, but easier to calculate. We're doing this because calculating lots of msec-based timestamps requires lots of 64/32 division operations, which can be inefficient on 32-bit platforms. We make sure that these stamps can be calculated using only the coarse monotonic timer and 32-bit bitwise operations. --- src/common/buffers.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/common/buffers.h') diff --git a/src/common/buffers.h b/src/common/buffers.h index 1eaa5f2d04..fe392d268f 100644 --- a/src/common/buffers.h +++ b/src/common/buffers.h @@ -79,8 +79,7 @@ typedef struct chunk_t { size_t DBG_alloc; #endif char *data; /**< A pointer to the first byte of data stored in mem. */ - uint32_t inserted_time; /**< Timestamp in truncated ms since epoch - * when this chunk was inserted. */ + uint32_t inserted_time; /**< Timestamp when this chunk was inserted. */ char mem[FLEXIBLE_ARRAY_MEMBER]; /**< The actual memory used for storage in * this chunk. */ } chunk_t; -- cgit v1.2.3-54-g00ecf