[tarantool-patches] Re: [PATCH v2 1/1] box: create bigrefs for tuples

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu May 31 18:29:30 MSK 2018


One more comment. I have an idea how to remove FLAG from enum.

Lets do this:

diff --git a/src/box/tuple.h b/src/box/tuple.h
index dd5e11e5e..e8bcf5cf9 100644
--- a/src/box/tuple.h
+++ b/src/box/tuple.h
@@ -308,7 +308,8 @@ box_tuple_upsert(const box_tuple_t *tuple, const char *expr, const
  struct PACKED tuple
  {
         /** reference counter */
-       uint16_t refs;
+       uint16_t refs : 15;
+       bool is_bigref : 1;
         /** format identifier */
         uint16_t format_id;
         /**

So you still store 15 bits refs and 1 bit flag. But now can access
them directly with no xor. I have checked, it weights the same byte count as
single uint16_t field. (sizeof(tuple) is still 10).




More information about the Tarantool-patches mailing list