[tarantool-patches] Re: [PATCH v1 00/21] sql: remove SQL error system.

Mergen Imeev imeevma at tarantool.org
Tue May 28 14:12:19 MSK 2019


On Sat, May 25, 2019 at 07:36:02PM +0300, n.pettik wrote:
> I’ve pushed couple of follow-ups:
> https://github.com/tarantool/tarantool/tree/np/gh-4074-follow-ups <https://github.com/tarantool/tarantool/tree/np/gh-4074-follow-ups>
> 
> Check them out please.
> 
Before I cherry-picked your patch, I made some changes to the
"sql: disable lookaside system" patch and resolved the conflicts
that appeared during the cherry-pick.

Diff for patch "sql: disable lookaside system":

diff --git a/src/box/sql/malloc.c b/src/box/sql/malloc.c
index 5c9c8d5..a7549db 100644
--- a/src/box/sql/malloc.c
+++ b/src/box/sql/malloc.c
@@ -681,35 +681,9 @@ sqlDbMallocRaw(sql * db, u64 n)
 void *
 sqlDbMallocRawNN(sql * db, u64 n)
 {
-#ifndef SQL_OMIT_LOOKASIDE
-	LookasideSlot *pBuf;
-	assert(db != 0);
-	assert(db->pnBytesFreed == 0);
-	if (db->lookaside.bDisable == 0) {
-		assert(db->mallocFailed == 0);
-		if (n > db->lookaside.sz) {
-			db->lookaside.anStat[1]++;
-		} else if ((pBuf = db->lookaside.pFree) == 0) {
-			db->lookaside.anStat[2]++;
-		} else {
-			db->lookaside.pFree = pBuf->pNext;
-			db->lookaside.nOut++;
-			db->lookaside.anStat[0]++;
-			if (db->lookaside.nOut > db->lookaside.mxOut) {
-				db->lookaside.mxOut = db->lookaside.nOut;
-			}
-			return (void *)pBuf;
-		}
-	} else if (db->mallocFailed) {
-		return 0;
-	}
-#else
-	assert(db != 0);
-	assert(db->pnBytesFreed == 0);
-	if (db->mallocFailed) {
-		return 0;
-	}
-#endif
+	assert(db != NULL && db->pnBytesFreed == NULL);
+	if (db->mallocFailed)
+		return NULL;
 	return dbMallocRawFinish(db, n);
 }





More information about the Tarantool-patches mailing list