diff options
Diffstat (limited to 'src/mem1.c')
-rw-r--r-- | src/mem1.c | 22 |
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 */ |