From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 736122DCA9 for ; Mon, 29 Apr 2019 13:26:21 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cJEFCiXa7xeM for ; Mon, 29 Apr 2019 13:26:21 -0400 (EDT) Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 1C5072DCE7 for ; Mon, 29 Apr 2019 13:26:21 -0400 (EDT) From: Stanislav Zudin Subject: [tarantool-patches] [PATCH 3/8] Removes unused functions. Date: Mon, 29 Apr 2019 20:26:06 +0300 Message-Id: <8ec96c08de6b7b34af688c027afc99664c666ac2.1556553117.git.szudin@tarantool.org> In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org, korablev@tarantool.org Cc: Stanislav Zudin 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