mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Additional refinements on the amalgamation: Give a couple of constants
file scope and add the SQLITE_API prefix to some interfaces that need it. Ticket #2554. (CVS 4199) FossilOrigin-Name: c09ec102c4f62e492dd3676ef0aa1a183d6ce3b3
This commit is contained in:
10
src/malloc.c
10
src/malloc.c
@@ -12,7 +12,7 @@
|
||||
** Memory allocation functions used throughout sqlite.
|
||||
**
|
||||
**
|
||||
** $Id: malloc.c,v 1.3 2007/06/15 20:29:20 drh Exp $
|
||||
** $Id: malloc.c,v 1.4 2007/08/08 01:04:52 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -792,10 +792,10 @@ void sqlite3SetString(char **pz, ...){
|
||||
** then the connection error-code (the value returned by sqlite3_errcode())
|
||||
** is set to SQLITE_NOMEM.
|
||||
*/
|
||||
int sqlite3_mallocHasFailed = 0;
|
||||
int sqlite3MallocHasFailed = 0;
|
||||
int sqlite3ApiExit(sqlite3* db, int rc){
|
||||
if( sqlite3MallocFailed() ){
|
||||
sqlite3_mallocHasFailed = 0;
|
||||
sqlite3MallocHasFailed = 0;
|
||||
sqlite3OsLeaveMutex();
|
||||
sqlite3Error(db, SQLITE_NOMEM, 0);
|
||||
rc = SQLITE_NOMEM;
|
||||
@@ -809,8 +809,8 @@ int sqlite3ApiExit(sqlite3* db, int rc){
|
||||
void sqlite3FailedMalloc(){
|
||||
if( !sqlite3MallocFailed() ){
|
||||
sqlite3OsEnterMutex();
|
||||
assert( sqlite3_mallocHasFailed==0 );
|
||||
sqlite3_mallocHasFailed = 1;
|
||||
assert( sqlite3MallocHasFailed==0 );
|
||||
sqlite3MallocHasFailed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user