Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 7/8] tuple: zap tuple_format_dup
Date: Sun, 14 Oct 2018 21:16:51 +0300	[thread overview]
Message-ID: <917bab267b2848c020cad5a558054f2f2983b4c6.1539539421.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1539539421.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1539539421.git.vdavydov.dev@gmail.com>

This function was only used for creating a format for tuples with column
mask in vinyl. Not needed anymore and can be removed.

Anyway, it doesn't make much sense to duplciate a tuple format, because
it can be referenced instead. Besides, once JSON indexes are introcued,
duplicating a tuple format will be really painful. One more reason to
drop it now.
---
 src/box/tuple_format.c | 22 ----------------------
 src/box/tuple_format.h | 10 ----------
 2 files changed, 32 deletions(-)

diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c
index 5f4899d9..c510ffd9 100644
--- a/src/box/tuple_format.c
+++ b/src/box/tuple_format.c
@@ -324,28 +324,6 @@ tuple_format1_can_store_format2_tuples(const struct tuple_format *format1,
 	return true;
 }
 
-struct tuple_format *
-tuple_format_dup(struct tuple_format *src)
-{
-	uint32_t total = sizeof(struct tuple_format) +
-			 src->field_count * sizeof(struct tuple_field);
-	struct tuple_format *format = (struct tuple_format *) malloc(total);
-	if (format == NULL) {
-		diag_set(OutOfMemory, total, "malloc", "tuple format");
-		return NULL;
-	}
-	memcpy(format, src, total);
-	tuple_dictionary_ref(format->dict);
-	format->id = FORMAT_ID_NIL;
-	format->refs = 0;
-	if (tuple_format_register(format) != 0) {
-		tuple_format_destroy(format);
-		free(format);
-		return NULL;
-	}
-	return format;
-}
-
 /** @sa declaration for details. */
 int
 tuple_init_field_map(const struct tuple_format *format, uint32_t *field_map,
diff --git a/src/box/tuple_format.h b/src/box/tuple_format.h
index 344aada7..cbd4e4b4 100644
--- a/src/box/tuple_format.h
+++ b/src/box/tuple_format.h
@@ -233,16 +233,6 @@ tuple_format1_can_store_format2_tuples(const struct tuple_format *format1,
 				       const struct tuple_format *format2);
 
 /**
- * Register the duplicate of the specified format.
- * @param src Original format.
- *
- * @retval not NULL Success.
- * @retval     NULL Memory or format register error.
- */
-struct tuple_format *
-tuple_format_dup(struct tuple_format *src);
-
-/**
  * Returns the total size of tuple metadata of this format.
  * See @link struct tuple @endlink for explanation of tuple layout.
  *
-- 
2.11.0

  parent reply	other threads:[~2018-10-14 18:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14 18:16 [PATCH 0/8] Get rid of Vinyl's mem_format_with_colmask Vladimir Davydov
2018-10-14 18:16 ` [PATCH 1/8] vinyl: move update optimization from write iterator to tx Vladimir Davydov
2018-10-23  7:35   ` [tarantool-patches] " Konstantin Osipov
2018-10-14 18:16 ` [PATCH 2/8] vinyl: factor out common code of UPDATE and UPSERT Vladimir Davydov
2018-10-23  7:36   ` [tarantool-patches] " Konstantin Osipov
2018-10-14 18:16 ` [PATCH 3/8] vinyl: do not use column mask as trigger for turning REPLACE into INSERT Vladimir Davydov
2018-10-23  7:37   ` [tarantool-patches] " Konstantin Osipov
2018-10-14 18:16 ` [PATCH 4/8] vinyl: explicitly pass column mask to vy_tx_set Vladimir Davydov
2018-10-14 18:16 ` [PATCH 5/8] vinyl: explicitly pass column mask to vy_check_is_unique Vladimir Davydov
2018-10-14 18:16 ` [PATCH 6/8] vinyl: zap vy_stmt_column_mask and mem_format_with_colmask Vladimir Davydov
2018-10-14 18:16 ` Vladimir Davydov [this message]
2018-10-14 18:16 ` [PATCH 8/8] tuple: zap tuple_extra Vladimir Davydov
2018-10-23  7:42   ` [tarantool-patches] " Konstantin Osipov
2018-10-23  8:32     ` Vladimir Davydov
2018-10-23  7:32 ` [tarantool-patches] Re: [PATCH 0/8] Get rid of Vinyl's mem_format_with_colmask Konstantin Osipov
2018-10-23  8:22   ` Vladimir Davydov
2018-10-24 11:13 ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=917bab267b2848c020cad5a558054f2f2983b4c6.1539539421.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 7/8] tuple: zap tuple_format_dup' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox