aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2008-03-26 18:34:43 +0000
committerdanielk1977 <danielk1977@noemail.net>2008-03-26 18:34:43 +0000
commitdfb316d43242a61212feec6c1293b4519f348a79 (patch)
treeeef6a718c5ecdc19aa03a165b8bdbc4c4ed96297 /src/malloc.c
parent7e2e6dc9505b9dec7fd809020ede9db4bfd9a694 (diff)
downloadsqlite-dfb316d43242a61212feec6c1293b4519f348a79.tar.gz
sqlite-dfb316d43242a61212feec6c1293b4519f348a79.zip
Changes to delay freeing buffers associated with vdbe memory cells until either sqlite3_finalize() or sqlite3_release_memory() is called. (CVS 4922)
FossilOrigin-Name: 8c2f69521f13bc24cf005520efbe0589eeadd763
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c
index a04734868..55d5c76de 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -12,7 +12,7 @@
** Memory allocation functions used throughout sqlite.
**
**
-** $Id: malloc.c,v 1.14 2007/10/20 16:36:31 drh Exp $
+** $Id: malloc.c,v 1.15 2008/03/26 18:34:43 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -59,7 +59,9 @@ void sqlite3_soft_heap_limit(int n){
*/
int sqlite3_release_memory(int n){
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
- return sqlite3PagerReleaseMemory(n);
+ int nRet = sqlite3VdbeReleaseMemory(n);
+ nRet += sqlite3PagerReleaseMemory(n-nRet);
+ return nRet;
#else
return SQLITE_OK;
#endif