[Tarantool-patches] [PATCH v4 00/53] Move mem-related functions to mem.c/mem.h

imeevma at tarantool.org imeevma at tarantool.org
Tue Mar 23 12:34:37 MSK 2021


This patch-set moves all MEM-related functions to mem.c and mem.h. This is done
to encapsulate struct MEM whicl allows us to simplify addition of new field
types.

https://github.com/tarantool/tarantool/issues/5818
https://github.com/tarantool/tarantool/tree/imeevma/gh-5818-encapsulate-mem-type-checking-and-changing

Changes in v4:
  - Patch-set was completely reworked.

Changes in v3:
  - Inlined most of the introduced functions to improve performance.
  - Some other fixes in code to improve performance.

Changes in v2:
  - Squashed almost all patches.
  - Review fixes.

Mergen Imeev (53):
  sql: enchance vdbe_decode_msgpack_into_mem()
  sql: disable unused code in sql/analyze.c
  sql: disable unused code in sql/legacy.c
  sql: remove NULL-termination in OP_ResultRow
  sql: move MEM-related functions to mem.c/mem.h
  sql: remove unused MEM-related functions
  sql: disable unused code in sql/vdbemem.c
  sql: introduce mem_str()
  sql: introduce mem_create()
  sql: introduce mem_destroy()
  sql: introduce mem_is_*() functions()
  sql: introduce mem_copy()
  sql: introduce mem_copy_as_ephemeral()
  sql: rework mem_move()
  sql: rework vdbe_decode_msgpack_into_mem()
  sql: remove sql_column_to_messagepack()
  sql: introduce mem_concat()
  sql: introduce mem_arithmetic()
  sql: introduce mem_compare()
  sql: introduce mem_bitwise()
  sql: introduce mem_bit_not()
  sql: Initialize MEM in sqlVdbeAllocUnpackedRecord()
  sql: introduce mem_set_null()
  sql: introduce mem_set_integer()
  sql: introduce mem_set_unsigned()
  sql: introduce mem_set_boolean()
  sql: refactor mem_set_double()
  sql: refactor mem_set_*_string()
  sql: introduce mem_copy_string()
  sql: introduce mem_set_*_binary()
  sql: introduce mem_copy_binary()
  sql: introduce mem_set_zerobinary()
  sql: introduce mem_append_to_binary()
  sql: introduce mem_set_*_map() and mem_set_*_array()
  sql: introduce mem_set_undefined()
  sql: introduce mem_set_pointer()
  sql: introduce mem_set_frame()
  sql: introduce mem_*_aggregate()
  sql: introduce mem_set_cleared()
  sql: move MEM flags to mem.c
  sql: introduce mem_convert_to_integer()
  sql: introduce mem_convert_to_double()
  sql: introduce mem_convert_to_number()
  sql: introduce mem_convert_to_string()
  sql: introduce mem_explicit_cast()
  sql: introduce mem_implicit_cast()
  sql: introduce mem_get_integer()
  sql: introduce mem_get_unsigned()
  sql: introduce mem_get_double()
  sql: introduce mem_get_boolean()
  sql: introduce mem_get_string0()
  sql: introduce mem_get_binary()
  sql: introduce mem_get_length()

 src/box/CMakeLists.txt  |    1 +
 src/box/execute.c       |  130 +-
 src/box/sql.c           |   96 +-
 src/box/sql.h           |    8 -
 src/box/sql/analyze.c   |   82 +-
 src/box/sql/build.c     |    1 +
 src/box/sql/func.c      |  370 +++--
 src/box/sql/insert.c    |    1 +
 src/box/sql/legacy.c    |    4 +
 src/box/sql/main.c      |    1 +
 src/box/sql/mem.c       | 2994 +++++++++++++++++++++++++++++++++++++++
 src/box/sql/mem.h       |  530 +++++++
 src/box/sql/pragma.c    |    1 +
 src/box/sql/printf.c    |   16 +-
 src/box/sql/select.c    |    3 +-
 src/box/sql/sqlInt.h    |  167 +--
 src/box/sql/trigger.c   |    1 +
 src/box/sql/vdbe.c      | 1220 +++-------------
 src/box/sql/vdbe.h      |    1 -
 src/box/sql/vdbeInt.h   |  314 +---
 src/box/sql/vdbeapi.c   |  438 ++----
 src/box/sql/vdbeaux.c   |  656 +--------
 src/box/sql/vdbemem.c   | 1324 +----------------
 src/box/sql/vdbesort.c  |    9 +-
 src/box/sql/vdbetrace.c |   34 +-
 src/box/sql/where.c     |    1 +
 src/box/sql/whereexpr.c |    7 +-
 27 files changed, 4260 insertions(+), 4150 deletions(-)
 create mode 100644 src/box/sql/mem.c
 create mode 100644 src/box/sql/mem.h

-- 
2.25.1



More information about the Tarantool-patches mailing list