mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Modify the memory allocation system in mem3.c so to fit in with the new sqlite3_mem_methods scheme. At this point it only "mostly" works. (CVS 5297)
FossilOrigin-Name: 3febef548fb1c314336fe4bc359d72a4fe84e84e
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -14,7 +14,7 @@
|
||||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
**
|
||||
** $Id: main.c,v 1.458 2008/06/23 14:15:53 danielk1977 Exp $
|
||||
** $Id: main.c,v 1.459 2008/06/24 19:02:55 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -149,13 +149,21 @@ int sqlite3_config(int op, ...){
|
||||
sqlite3Config.bFullMutex = 1;
|
||||
break;
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_MEMPOOL
|
||||
case SQLITE_CONFIG_MEMPOOL: {
|
||||
u8 *pMem = va_arg(ap, u8*);
|
||||
int nMem = va_arg(ap, int);
|
||||
rc = sqlite3MemSetMempool(pMem, nMem);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case SQLITE_CONFIG_MALLOC: {
|
||||
/* Specify an alternative malloc implementation */
|
||||
sqlite3Config.m = *va_arg(ap, sqlite3_mem_methods*);
|
||||
break;
|
||||
}
|
||||
case SQLITE_CONFIG_GETMALLOC: {
|
||||
/* Specify an alternative malloc implementation */
|
||||
/* Retrieve the current malloc() implementation */
|
||||
if( sqlite3Config.m.xMalloc==0 ) sqlite3MemSetDefault();
|
||||
*va_arg(ap, sqlite3_mem_methods*) = sqlite3Config.m;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user