mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Automatically deallocate thread-specific data when it is no longer
being used. Ticket #1601. Also implemented the suggestion of ticket #1603. Memory management is now off by default at compile-time. The sqlite3_enable_memory_management() API has been removed. (CVS 2919) FossilOrigin-Name: 5d9c6aa964305c3f36741ff0058da5b5f3ce0d24
This commit is contained in:
@@ -156,7 +156,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){
|
||||
sqlite3 *db;
|
||||
int rc;
|
||||
|
||||
assert(!sqlite3ThreadData()->mallocFailed);
|
||||
assert(!sqlite3ThreadDataReadOnly()->mallocFailed);
|
||||
|
||||
if( p==0 || p->magic!=VDBE_MAGIC_RUN ){
|
||||
return SQLITE_MISUSE;
|
||||
@@ -404,7 +404,7 @@ static void columnMallocFailure(sqlite3_stmt *pStmt)
|
||||
** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
|
||||
** and _finalize() will return NOMEM.
|
||||
*/
|
||||
if( sqlite3ThreadData()->mallocFailed ){
|
||||
if( sqlite3ThreadDataReadOnly()->mallocFailed ){
|
||||
((Vdbe *)pStmt)->rc = SQLITE_NOMEM;
|
||||
sqlite3MallocClearFailed();
|
||||
}
|
||||
|
Reference in New Issue
Block a user