Tarantool development patches archive
 help / color / mirror / Atom feed
From: Stanislav Zudin <szudin@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Stanislav Zudin <szudin@tarantool.org>
Subject: [tarantool-patches] [PATCH 3/8] Removes unused functions.
Date: Mon, 29 Apr 2019 20:26:06 +0300	[thread overview]
Message-ID: <8ec96c08de6b7b34af688c027afc99664c666ac2.1556553117.git.szudin@tarantool.org> (raw)
In-Reply-To: <cover.1556553117.git.szudin@tarantool.org>
In-Reply-To: <cover.1556553117.git.szudin@tarantool.org>

Part of #3978
---
 src/box/sql/hwtime.h | 63 --------------------------------------------
 src/box/sql/main.c   | 21 ---------------
 src/box/sql/malloc.c | 48 ---------------------------------
 src/box/sql/sqlInt.h |  8 ------
 4 files changed, 140 deletions(-)

diff --git a/src/box/sql/hwtime.h b/src/box/sql/hwtime.h
index 278a1bf1c..f2196360b 100644
--- a/src/box/sql/hwtime.h
+++ b/src/box/sql/hwtime.h
@@ -43,34 +43,6 @@
  * processor and returns that value.  This can be used for high-res
  * profiling.
  */
-#if (defined(__GNUC__) || defined(_MSC_VER)) && \
-      (defined(i386) || defined(__i386__) || defined(_M_IX86))
-
-#if defined(__GNUC__)
-
-__inline__ sql_uint64
-sqlHwtime(void)
-{
-	unsigned int lo, hi;
-	__asm__ __volatile__("rdtsc":"=a"(lo), "=d"(hi));
-	return (sql_uint64) hi << 32 | lo;
-}
-
-#elif defined(_MSC_VER)
-
-__declspec(naked)
-__inline sql_uint64 __cdecl
-sqlHwtime(void)
-{
-	__asm {
-		rdtsc ret;
- return value at EDX:EAX}
-}
-
-#endif
-
-#elif (defined(__GNUC__) && defined(__x86_64__))
-
 __inline__ sql_uint64
 sqlHwtime(void)
 {
@@ -79,39 +51,4 @@ sqlHwtime(void)
 	return val;
 }
 
-#elif (defined(__GNUC__) && defined(__ppc__))
-
-__inline__ sql_uint64
-sqlHwtime(void)
-{
-	unsigned long long retval;
-	unsigned long junk;
-	__asm__ __volatile__("\n\
-          1:      mftbu   %1\n\
-                  mftb    %L0\n\
-                  mftbu   %0\n\
-                  cmpw    %0,%1\n\
-                  bne     1b":"=r"(retval), "=r"(junk));
-	return retval;
-}
-
-#else
-
-#error Need implementation of sqlHwtime() for your platform.
-
-  /*
-   * To compile without implementing sqlHwtime() for your platform,
-   * you can remove the above #error and use the following
-   * stub function.  You will lose timing support for many
-   * of the debugging and testing utilities, but it should at
-   * least compile and run.
-   */
-sql_uint64
-sqlHwtime(void)
-{
-	return ((sql_uint64) 0);
-}
-
-#endif
-
 #endif				/* !defined(SQL_HWTIME_H) */
diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index fe1135a71..a188f2e8a 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -513,27 +513,6 @@ sql_create_function_v2(sql * db,
 	return rc;
 }
 
-#ifndef SQL_OMIT_TRACE
-/* Register a trace callback using the version-2 interface.
- */
-int
-sql_trace_v2(sql * db,		/* Trace this connection */
-		 unsigned mTrace,	/* Mask of events to be traced */
-		 int (*xTrace) (unsigned, void *, void *, void *),	/* Callback to invoke */
-		 void *pArg)		/* Context */
-{
-	if (mTrace == 0)
-		xTrace = 0;
-	if (xTrace == 0)
-		mTrace = 0;
-	db->mTrace = mTrace;
-	db->xTrace = xTrace;
-	db->pTraceArg = pArg;
-	return SQL_OK;
-}
-
-#endif				/* SQL_OMIT_TRACE */
-
 /*
  * This function returns true if main-memory should be used instead of
  * a temporary file for transient pager files and statement journals.
diff --git a/src/box/sql/malloc.c b/src/box/sql/malloc.c
index ef10d64ae..4bb96111f 100644
--- a/src/box/sql/malloc.c
+++ b/src/box/sql/malloc.c
@@ -253,15 +253,6 @@ sqlHeapNearlyFull(void)
 	return mem0.nearlyFull;
 }
 
-/*
- * Deinitialize the memory allocation subsystem.
- */
-void
-sqlMallocEnd(void)
-{
-	memset(&mem0, 0, sizeof(mem0));
-}
-
 /*
  * Return the amount of memory currently checked out.
  */
@@ -273,19 +264,6 @@ sql_memory_used(void)
 	return res;
 }
 
-/*
- * Return the maximum amount of memory that has ever been
- * checked out since either the beginning of this process
- * or since the most recent reset.
- */
-sql_int64
-sql_memory_highwater(int resetFlag)
-{
-	sql_int64 res, mx;
-	sql_status64(SQL_STATUS_MEMORY_USED, &res, &mx, resetFlag);
-	return mx;
-}
-
 /*
  * Trigger the alarm
  */
@@ -421,14 +399,6 @@ sqlDbMallocSize(sql * db, void *p)
 		return db->lookaside.sz;
 }
 
-sql_uint64
-sql_msize(void *p)
-{
-	assert(sqlMemdebugNoType(p, (u8) ~ MEMTYPE_HEAP));
-	assert(sqlMemdebugHasType(p, MEMTYPE_HEAP));
-	return p ? sql_sized_sizeof(p) : 0;
-}
-
 /*
  * Free memory previously obtained from sqlMalloc().
  */
@@ -545,14 +515,6 @@ sqlRealloc(void *pOld, u64 nBytes)
  * The public interface to sqlRealloc.  Make sure that the memory
  * subsystem is initialized prior to invoking sqlRealloc.
  */
-void *
-sql_realloc(void *pOld, int n)
-{
-	if (n < 0)
-		n = 0;		/* IMP: R-26507-47431 */
-	return sqlRealloc(pOld, n);
-}
-
 void *
 sql_realloc64(void *pOld, sql_uint64 n)
 {
@@ -777,16 +739,6 @@ sqlDbStrNDup(sql * db, const char *z, u64 n)
 	return zNew;
 }
 
-/*
- * Free any prior content in *pz and replace it with a copy of zNew.
- */
-void
-sqlSetString(char **pz, sql * db, const char *zNew)
-{
-	sqlDbFree(db, *pz);
-	*pz = sqlDbStrDup(db, zNew);
-}
-
 /*
  * Call this routine to record the fact that an OOM (out-of-memory) error
  * has happened.  This routine will set db->mallocFailed, and also
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 3f3658421..6ddc7d486 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -398,18 +398,12 @@ sql_malloc(int);
 void *
 sql_malloc64(sql_uint64);
 
-void *
-sql_realloc(void *, int);
-
 void *
 sql_realloc64(void *, sql_uint64);
 
 void
 sql_free(void *);
 
-sql_uint64
-sql_msize(void *);
-
 int
 sql_stricmp(const char *, const char *);
 
@@ -2964,7 +2958,6 @@ unsigned sqlStrlen30(const char *);
 #define sqlStrNICmp sql_strnicmp
 
 void sqlMallocInit(void);
-void sqlMallocEnd(void);
 void *sqlMalloc(u64);
 void *sqlMallocZero(u64);
 void *sqlDbMallocZero(sql *, u64);
@@ -3035,7 +3028,6 @@ void sqlTreeViewSelect(TreeView *, const Select *, u8);
 void sqlTreeViewWith(TreeView *, const With *);
 #endif
 
-void sqlSetString(char **, sql *, const char *);
 void sqlDequote(char *);
 
 /**
-- 
2.17.1

  parent reply	other threads:[~2019-04-29 17:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 17:26 [tarantool-patches] [PATCH 0/8] sql: cleanup code from obsolete macros Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 1/8] " Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 2/8] Removes unused functions and commented many years ago code Stanislav Zudin
2019-05-19 15:15   ` [tarantool-patches] " n.pettik
2019-05-29  8:21     ` Stanislav Zudin
2019-04-29 17:26 ` Stanislav Zudin [this message]
2019-04-29 17:26 ` [tarantool-patches] [PATCH 4/8] Removes unused functions and macros Stanislav Zudin
2019-05-19 15:16   ` [tarantool-patches] " n.pettik
2019-05-29 14:01     ` Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 5/8] Removes the following unused macros: SQL_ENABLE_MEMORY_MANAGEMENT SQL_ENABLE_UNKNOWN_SQL_FUNCTION SQL_SUBSTR_COMPATIBILITY SQL_ENABLE_STMT_SCANSTATUS Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 6/8] Removes the following unused macros: SQL_EXPLAIN_ESTIMATED_ROWS SQL_ENABLE_COLUMN_USED_MASK SQL_DISABLE_DIRSYNC SQL_OMIT_AUTOMATIC_INDEX SQL_DEBUG_SORTER_THREADS SQL_DEFAULT_WORKER_THREADS SQL_LIMIT_WORKER_THREADS SQL_MAX_WORKER_THREADS Stanislav Zudin
2019-05-19 15:16   ` [tarantool-patches] " n.pettik
2019-05-29 14:02     ` Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 7/8] Removes unused constants Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 8/8] Removes the following unused macros: SQL_PRINTF_PRECISION_LIMIT SQL_OMIT_COMPOUND_SELECT SQL_POWERSAFE_OVERWRITE SQL_OMIT_PROGRESS_CALLBACK SQL_OMIT_AUTORESET SQL_OMIT_DECLTYPE SQL_ENABLE_COLUMN_METADATA SQL_TRACE_SIZE_LIMIT SQL_OMIT_LIKE_OPTIMIZATION SQL_OMIT_OR_OPTIMIZATION SQL_OMIT_BETWEEN_OPTIMIZATION Stanislav Zudin

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=8ec96c08de6b7b34af688c027afc99664c666ac2.1556553117.git.szudin@tarantool.org \
    --to=szudin@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH 3/8] Removes unused functions.' \
    /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