summaryrefslogtreecommitdiff
path: root/src/common/buffers.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-21 12:28:16 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-27 09:43:15 -0500
commitc3c0a05f51eff73e624b18f651339ed08a122e3d (patch)
treef679e50de45db6c6a5218bdb0815da4f5f058172 /src/common/buffers.h
parentda82e0b5795c449f4442c87e065e9a60da4892a8 (diff)
downloadtor-c3c0a05f51eff73e624b18f651339ed08a122e3d.tar.gz
tor-c3c0a05f51eff73e624b18f651339ed08a122e3d.zip
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.
Diffstat (limited to 'src/common/buffers.h')
-rw-r--r--src/common/buffers.h3
1 files changed, 1 insertions, 2 deletions
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 <b>mem</b>. */
- 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;