1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-28 19:36:04 +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:
drh
2007-08-08 01:04:52 +00:00
parent fd131daecd
commit f7083bf6d2
6 changed files with 23 additions and 23 deletions

View File

@@ -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;
}
}

View File

@@ -36,8 +36,8 @@
unsigned int sqlite3_pending_byte = 0x40000000;
#endif
#ifdef SQLITE_TEST
int sqlite3_os_trace = 0;
#ifdef SQLITE_DEBUG
#define OSTRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X)
#define OSTRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y)
#define OSTRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z)

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.583 2007/08/07 17:13:04 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.584 2007/08/08 01:04:52 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -256,15 +256,15 @@ extern int sqlite3_iLine; /* Line number for debug info */
#endif
/* Variable sqlite3_mallocHasFailed is set to true after a malloc()
/* Variable sqlite3MallocHasFailed is set to true after a malloc()
** failure occurs.
**
** The sqlite3MallocFailed() macro returns true if a malloc has failed
** in this thread since the last call to sqlite3ApiExit(), or false
** otherwise.
*/
extern int sqlite3_mallocHasFailed;
#define sqlite3MallocFailed() (sqlite3_mallocHasFailed && sqlite3OsInMutex(1))
extern int sqlite3MallocHasFailed;
#define sqlite3MallocFailed() (sqlite3MallocHasFailed && sqlite3OsInMutex(1))
#define sqliteFree(x) sqlite3FreeX(x)
#define sqliteAllocSize(x) sqlite3AllocSize(x)