1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Where possible, avoid freeing buffers allocated for vdbe memory cells in case they can be reused. (CVS 4783)

FossilOrigin-Name: 990237e27e417aff3dbf05784b716c21f3761a3a
This commit is contained in:
danielk1977
2008-02-13 18:25:27 +00:00
parent 0f35a6b529
commit a7a8e14bf2
25 changed files with 548 additions and 441 deletions

View File

@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
** $Id: tclsqlite.c,v 1.207 2007/11/14 06:48:48 danielk1977 Exp $
** $Id: tclsqlite.c,v 1.208 2008/02/13 18:25:27 danielk1977 Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -1702,7 +1702,9 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
switch( sqlite3_column_type(pStmt, i) ){
case SQLITE_BLOB: {
int bytes = sqlite3_column_bytes(pStmt, i);
pVal = Tcl_NewByteArrayObj(sqlite3_column_blob(pStmt, i), bytes);
char *zBlob = sqlite3_column_blob(pStmt, i);
if( !zBlob ) bytes = 0;
pVal = Tcl_NewByteArrayObj(zBlob, bytes);
break;
}
case SQLITE_INTEGER: {