diff options
| author | Keith Bostic <keith.bostic@mongodb.com> | 2017-07-30 21:11:02 -0400 |
|---|---|---|
| committer | Michael Cahill <michael.cahill@mongodb.com> | 2017-07-31 11:11:02 +1000 |
| commit | 2e9744d11a65c63ba7445060dc78371250f04051 (patch) | |
| tree | 218b2530a6f5e587f59a3c98496b87f290dcff22 /src/include | |
| parent | 9494eb2899e010c378f882348ff3b58d37ecab08 (diff) | |
WT-3467 Minor lint/cleanup (#3541)mongodb-3.5.11
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/bitstring.i | 3 | ||||
| -rw-r--r-- | src/include/btmem.h | 16 | ||||
| -rw-r--r-- | src/include/buf.i | 24 | ||||
| -rw-r--r-- | src/include/serial.i | 15 |
4 files changed, 26 insertions, 32 deletions
diff --git a/src/include/bitstring.i b/src/include/bitstring.i index a9ec91d49ff..bd14fa613a8 100644 --- a/src/include/bitstring.i +++ b/src/include/bitstring.i @@ -166,8 +166,6 @@ __bit_ffc(uint8_t *bitf, uint64_t nbits, uint64_t *retp) uint8_t lb; uint64_t byte, stopbyte, value; - value = 0; /* -Wuninitialized */ - if (nbits == 0) return (-1); @@ -199,7 +197,6 @@ __bit_ffs(uint8_t *bitf, uint64_t nbits, uint64_t *retp) uint8_t lb; uint64_t byte, stopbyte, value; - value = 0; if (nbits == 0) return (-1); diff --git a/src/include/btmem.h b/src/include/btmem.h index b8447984b49..01a9179aedc 100644 --- a/src/include/btmem.h +++ b/src/include/btmem.h @@ -915,14 +915,6 @@ struct __wt_update { * the semantics we want. */ uint8_t data[]; /* start of the data */ - - /* - * The memory size of an update: include some padding because this is - * such a common case that overhead of tiny allocations can swamp our - * cache overhead calculation. - */ -#define WT_UPDATE_MEMSIZE(upd) \ - WT_ALIGN(WT_UPDATE_SIZE + (upd)->size, 32) }; /* @@ -932,6 +924,14 @@ struct __wt_update { #define WT_UPDATE_SIZE (21 + WT_TIMESTAMP_SIZE) /* + * The memory size of an update: include some padding because this is such a + * common case that overhead of tiny allocations can swamp our cache overhead + * calculation. + */ +#define WT_UPDATE_MEMSIZE(upd) \ + WT_ALIGN(WT_UPDATE_SIZE + (upd)->size, 32) + +/* * WT_MAX_MODIFY_UPDATE -- * Limit update chains to a small value to avoid penalizing reads and * permit truncation. diff --git a/src/include/buf.i b/src/include/buf.i index 17f67afefce..8ff52f86ced 100644 --- a/src/include/buf.i +++ b/src/include/buf.i @@ -116,18 +116,18 @@ __wt_scr_free(WT_SESSION_IMPL *session, WT_ITEM **bufp) { WT_ITEM *buf; - if ((buf = *bufp) != NULL) { - *bufp = NULL; + if ((buf = *bufp) == NULL) + return; + *bufp = NULL; - if (session->scratch_cached + buf->memsize >= - S2C(session)->session_scratch_max) { - __wt_free(session, buf->mem); - buf->memsize = 0; - } else - session->scratch_cached += buf->memsize; + if (session->scratch_cached + buf->memsize >= + S2C(session)->session_scratch_max) { + __wt_free(session, buf->mem); + buf->memsize = 0; + } else + session->scratch_cached += buf->memsize; - buf->data = NULL; - buf->size = 0; - F_CLR(buf, WT_ITEM_INUSE); - } + buf->data = NULL; + buf->size = 0; + F_CLR(buf, WT_ITEM_INUSE); } diff --git a/src/include/serial.i b/src/include/serial.i index 15d159192f9..d9c72cd2bad 100644 --- a/src/include/serial.i +++ b/src/include/serial.i @@ -259,8 +259,7 @@ __wt_insert_serial(WT_SESSION_IMPL *session, WT_PAGE *page, */ static inline int __wt_update_serial(WT_SESSION_IMPL *session, WT_PAGE *page, - WT_UPDATE **srch_upd, WT_UPDATE **updp, size_t upd_size, - bool exclusive) + WT_UPDATE **srch_upd, WT_UPDATE **updp, size_t upd_size, bool exclusive) { WT_DECL_RET; WT_UPDATE *obsolete, *upd = *updp; @@ -290,19 +289,17 @@ __wt_update_serial(WT_SESSION_IMPL *session, WT_PAGE *page, } /* - * Increment in-memory footprint after releasing the mutex: that's safe - * because the structures we added cannot be discarded while visible to - * any running transaction, and we're a running transaction, which means - * there can be no corresponding delete until we complete. + * Increment in-memory footprint after swapping the update into place. + * Safe because the structures we added cannot be discarded while + * visible to any running transaction, and we're a running transaction, + * which means there can be no corresponding delete until we complete. */ __wt_cache_page_inmem_incr(session, page, upd_size); /* Mark the page dirty after updating the footprint. */ __wt_page_modify_set(session, page); - /* - * If there are no subsequent WT_UPDATE structures we are done here. - */ + /* If there are no subsequent WT_UPDATE structures we are done here. */ if (upd->next == NULL || exclusive) return (0); |
