1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Disable checking the winMemData structure signature when compiled with NDEBUG.

FossilOrigin-Name: 50edc2f9141bd13277119afd129387029ebe5c01
This commit is contained in:
mistachkin
2011-08-26 01:45:50 +00:00
parent 155892cccc
commit 7da32b5841
3 changed files with 22 additions and 8 deletions

View File

@@ -153,16 +153,30 @@ struct winFile {
*/
typedef struct winMemData winMemData;
struct winMemData {
#ifndef NDEBUG
u32 magic; /* Magic number to detect structure corruption. */
#endif
HANDLE hHeap; /* The handle to our heap. */
BOOL bOwned; /* Do we own the heap (i.e. destroy it on shutdown)? */
};
#ifndef NDEBUG
#define WINMEM_MAGIC 0x42b2830b
#endif
static struct winMemData win_mem_data = { WINMEM_MAGIC, NULL, FALSE };
static struct winMemData win_mem_data = {
#ifndef NDEBUG
WINMEM_MAGIC,
#endif
NULL, FALSE
};
#ifndef NDEBUG
#define winMemAssertMagic() assert( win_mem_data.magic==WINMEM_MAGIC )
#else
#define winMemAssertMagic()
#endif
#define winMemGetHeap() win_mem_data.hHeap
static void *winMemMalloc(int nBytes);