aboutsummaryrefslogtreecommitdiff
path: root/src/mem1.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/mem1.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/mem1.c')
-rw-r--r--src/mem1.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mem1.c b/src/mem1.c
index 7f164f8ce..359ce5d8c 100644
--- a/src/mem1.c
+++ b/src/mem1.c
@@ -17,7 +17,7 @@
** This file contains implementations of the low-level memory allocation
** routines specified in the sqlite3_mem_methods object.
**
-** $Id: mem1.c,v 1.23 2008/06/23 15:10:25 danielk1977 Exp $
+** $Id: mem1.c,v 1.24 2008/07/24 08:20:40 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -120,13 +120,7 @@ static void sqlite3MemShutdown(void *NotUsed){
return;
}
-/*
-** This routine is the only routine in this file with external linkage.
-**
-** 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,
@@ -137,7 +131,17 @@ void sqlite3MemSetDefault(void){
sqlite3MemShutdown,
0
};
- sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods);
+ return &defaultMethods;
+}
+
+/*
+** This routine is the only routine in this file with external linkage.
+**
+** 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());
}
#endif /* SQLITE_SYSTEM_MALLOC */