aboutsummaryrefslogtreecommitdiff
path: root/src/mem2.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2008-07-24 08:20:40 +0000
committerdanielk1977 <danielk1977@noemail.net>2008-07-24 08:20:40 +0000
commit2d34081de9f3eeafe29155f953b5df351ad8af1b (patch)
tree250a63725fa3a6a68d2049cc2908bb1700e54b15 /src/mem2.c
parent80cc85b3c2f1454b27320d2485a4095e4e6d93b1 (diff)
downloadsqlite-2d34081de9f3eeafe29155f953b5df351ad8af1b.tar.gz
sqlite-2d34081de9f3eeafe29155f953b5df351ad8af1b.zip
Add mem6.c, a new allocator. More to come. (CVS 5467)
FossilOrigin-Name: 192bc192185a7b475ef9331e2a4a0dc68083ec03
Diffstat (limited to 'src/mem2.c')
-rw-r--r--src/mem2.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mem2.c b/src/mem2.c
index 5e9a999b7..46ae707e6 100644
--- a/src/mem2.c
+++ b/src/mem2.c
@@ -19,7 +19,7 @@
** This file contains implementations of the low-level memory allocation
** routines specified in the sqlite3_mem_methods object.
**
-** $Id: mem2.c,v 1.34 2008/07/10 18:13:42 drh Exp $
+** $Id: mem2.c,v 1.35 2008/07/24 08:20:40 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -304,11 +304,7 @@ static void *sqlite3MemRealloc(void *pPrior, int nByte){
}
-/*
-** Populate the low-level memory allocation function pointers in
-** sqlite3Config.m with pointers to the routines in this file.
-*/
-void sqlite3MemSetDefault(void){
+sqlite3_mem_methods *sqlite3MemGetDefault(void){
static const sqlite3_mem_methods defaultMethods = {
sqlite3MemMalloc,
sqlite3MemFree,
@@ -319,7 +315,15 @@ void sqlite3MemSetDefault(void){
sqlite3MemShutdown,
0
};
- sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods);
+ return &defaultMethods;
+}
+
+/*
+** Populate the low-level memory allocation function pointers in
+** sqlite3Config.m with pointers to the routines in this file.
+*/
+void sqlite3MemSetDefault(void){
+ sqlite3_config(SQLITE_CONFIG_MALLOC, sqlite3MemGetDefault());
}
/*