aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-06-30 16:29:59 +0000
committerdrh <drh@noemail.net>2015-06-30 16:29:59 +0000
commit59b4bd48402d7e3fd43c6421c914f941381ad67f (patch)
tree610aac3f446aa781e946a4f01f91496acae59cb9 /src/malloc.c
parentbe7d4978365fe110e08ad2ef2f4b09a19f350660 (diff)
parentda6d3e2117fd2ab1cbcc0f21ac5839d08d04344e (diff)
downloadsqlite-59b4bd48402d7e3fd43c6421c914f941381ad67f.tar.gz
sqlite-59b4bd48402d7e3fd43c6421c914f941381ad67f.zip
Merge all the latest enhancements from trunk. This merge include FTS5
and a number of notable performance enhancements. FossilOrigin-Name: 39936b33b0668aad81aa574d4d74c92b0ddd218a
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 1b9a20956..97b9cd577 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -796,17 +796,16 @@ static SQLITE_NOINLINE int apiOomError(sqlite3 *db){
** function. However, if a malloc() failure has occurred since the previous
** invocation SQLITE_NOMEM is returned instead.
**
-** If the first argument, db, is not NULL and a malloc() error has occurred,
-** then the connection error-code (the value returned by sqlite3_errcode())
-** is set to SQLITE_NOMEM.
+** If an OOM as occurred, then the connection error-code (the value
+** returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
*/
int sqlite3ApiExit(sqlite3* db, int rc){
- /* If the db handle is not NULL, then we must hold the connection handle
- ** mutex here. Otherwise the read (and possible write) of db->mallocFailed
+ /* If the db handle must hold the connection handle mutex here.
+ ** Otherwise the read (and possible write) of db->mallocFailed
** is unsafe, as is the call to sqlite3Error().
*/
- assert( !db || sqlite3_mutex_held(db->mutex) );
- if( db==0 ) return rc & 0xff;
+ assert( db!=0 );
+ assert( sqlite3_mutex_held(db->mutex) );
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){
return apiOomError(db);
}