[Tarantool-patches] [PATCH v1 19/21] sql: remove MEM_Dyn flag

Mergen Imeev imeevma at tarantool.org
Tue Nov 2 14:43:58 MSK 2021


Thank you for the review! My answer and diff below.

On Sat, Oct 30, 2021 at 01:43:12AM +0200, Vladislav Shpilevoy wrote:
> Thanks for the fixes!
> 
> SQL_TRANSIENT, SQL_DYNAMIC, and SQL_STATIC can all be deleted here.
True, thanks. Fixed.

Diff:

diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 22a4aa5cd..148350d05 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -370,10 +370,6 @@ sql_vsnprintf(int, char *, const char *, va_list);
 #define MATCH_ONE_WILDCARD '_'
 #define MATCH_ALL_WILDCARD '%'
 
-typedef void (*sql_destructor_type) (void *);
-#define SQL_STATIC      ((sql_destructor_type)0)
-#define SQL_TRANSIENT   ((sql_destructor_type)-1)
-
 /**
  * Compile the UTF-8 encoded SQL statement into
  * a statement handle (struct Vdbe).
@@ -873,16 +869,6 @@ typedef u64 uptr;
  */
 #define IsPowerOfTwo(X) (((X)&((X)-1))==0)
 
-/*
- * The following value as a destructor means to use sqlDbFree().
- * The sqlDbFree() routine requires two parameters instead of the
- * one parameter that destructors normally want.  So we have to introduce
- * this magic value that the code knows to handle differently.  Any
- * pointer will work here as long as it is distinct from sql_STATIC
- * and sql_TRANSIENT.
- */
-#define SQL_DYNAMIC   ((sql_destructor_type)sqlMallocSize)
-
 /*
  * The usual case where Writable Static Data (WSD) is supported,
  * the sql_WSD and GLOBAL macros become no-ops and have zero


More information about the Tarantool-patches mailing list