From: mistachkin Date: Thu, 15 Mar 2012 03:40:59 +0000 (+0000) Subject: Add SQLITE_WIN32_HEAP_CREATE compiler define to control whether or not the Win32... X-Git-Tag: version-3.7.13~11^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40c471d92112699c1ef65e725db4a29901c182fa;p=thirdparty%2Fsqlite.git Add SQLITE_WIN32_HEAP_CREATE compiler define to control whether or not the Win32 native allocator will create an isolated heap for all allocated data. FossilOrigin-Name: 8693fb652ecd1ad0b03e9067839970b321c3f904 --- diff --git a/manifest b/manifest index 73be5ae116..ccb0bed86a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\smacro\sissues\sfor\sosGetProcessHeap\sand\ssqlite3_win32_write_debug. -D 2012-03-14T23:08:59.126 +C Add\sSQLITE_WIN32_HEAP_CREATE\scompiler\sdefine\sto\scontrol\swhether\sor\snot\sthe\sWin32\snative\sallocator\swill\screate\san\sisolated\sheap\sfor\sall\sallocated\sdata. +D 2012-03-15T03:40:59.450 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -167,7 +167,7 @@ F src/os.h 38aabd5e3ecd4162332076f55bb09cec02165cca F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440 F src/os_unix.c 0e3d2942d228d0366fb80a3640f35caf413b66d1 -F src/os_win.c a2e9d48184b8b29075d7be2b5e990c4af48cf05a +F src/os_win.c 9bbe851c4299fd53dae0652fcd199025b755e8a4 F src/pager.c 3955b62cdb5bb64559607cb474dd12a6c8e1d4a5 F src/pager.h ef1eaf8593e78f73885c1dfac27ad83bee23bdc5 F src/parse.y 1ddd71ae55f4b7cbb2672526ea4de023de0f519e @@ -992,7 +992,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 845aa46f69784420ada4116078f8dc0a68cf3707 -R 19913ba6cd236428e778abd041ed11a4 +P d3d071598aba367e3d73001ab38d7a78306875ea +R 0bb904de4ab0ea378e0e14a8a8dc9e9c U mistachkin -Z 1c2030e83f925395c20a7055c12f2bff +Z a4be176b4e96926a736affae28592011 diff --git a/manifest.uuid b/manifest.uuid index 1a19b160bf..f8b2016426 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d3d071598aba367e3d73001ab38d7a78306875ea \ No newline at end of file +8693fb652ecd1ad0b03e9067839970b321c3f904 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 5d574fd438..21deea5599 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -106,6 +106,25 @@ struct winFile { * various Win32 API heap functions instead of our own. */ #ifdef SQLITE_WIN32_MALLOC + +/* + * If this is non-zero, an isolated heap will be created by the native Win32 + * allocator subsystem; otherwise, the default process heap will be used. This + * setting has no effect when compiling for WinRT. By default, this is enabled + * and an isolated heap will be created to store all allocated data. + * + ****************************************************************************** + * WARNING: It is important to note that when this setting is non-zero and the + * winMemShutdown function is called (e.g. by the sqlite3_shutdown + * function), all data that was allocated using the isolated heap will + * be freed immediately and any attempt to access any of that freed + * data will almost certainly result in an immediate access violation. + ****************************************************************************** + */ +#ifndef SQLITE_WIN32_HEAP_CREATE +# define SQLITE_WIN32_HEAP_CREATE (TRUE) +#endif + /* * The initial size of the Win32-specific heap. This value may be zero. */ @@ -1070,7 +1089,7 @@ static int winMemInit(void *pAppData){ if( !pWinMemData ) return SQLITE_ERROR; assert( pWinMemData->magic==WINMEM_MAGIC ); -#if !SQLITE_OS_WINRT +#if !SQLITE_OS_WINRT && SQLITE_WIN32_HEAP_CREATE if( !pWinMemData->hHeap ){ pWinMemData->hHeap = osHeapCreate(SQLITE_WIN32_HEAP_FLAGS, SQLITE_WIN32_HEAP_INIT_SIZE,