/ Check-in [50edc2f9]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Disable checking the winMemData structure signature when compiled with NDEBUG.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winNativeHeap
Files: files | file ages | folders
SHA1: 50edc2f9141bd13277119afd129387029ebe5c01
User & Date: mistachkin 2011-08-26 01:45:50
Context
2011-08-26
05:40
In the MSVC makefile, allow symbols to be enabled without NDEBUG defined. Also, for the win32lock test, make sure the database is closed prior to shutdown. Closed-Leaf check-in: 5ed7633d user: mistachkin tags: winNativeHeap
01:45
Disable checking the winMemData structure signature when compiled with NDEBUG. check-in: 50edc2f9 user: mistachkin tags: winNativeHeap
01:32
Allow the Win32 native heap flags to be overridden at compile-time. check-in: 1c2ecec8 user: mistachkin tags: winNativeHeap
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

   149    149   
   150    150   /*
   151    151   ** The winMemData structure stores information required by the Win32-specific
   152    152   ** sqlite3_mem_methods implementation.
   153    153   */
   154    154   typedef struct winMemData winMemData;
   155    155   struct winMemData {
          156  +#ifndef NDEBUG
   156    157     u32 magic;    /* Magic number to detect structure corruption. */
          158  +#endif
   157    159     HANDLE hHeap; /* The handle to our heap. */
   158    160     BOOL bOwned;  /* Do we own the heap (i.e. destroy it on shutdown)? */
   159    161   };
   160    162   
          163  +#ifndef NDEBUG
   161    164   #define WINMEM_MAGIC     0x42b2830b
          165  +#endif
   162    166   
   163         -static struct winMemData win_mem_data = { WINMEM_MAGIC, NULL, FALSE };
          167  +static struct winMemData win_mem_data = {
          168  +#ifndef NDEBUG
          169  +  WINMEM_MAGIC,
          170  +#endif
          171  +  NULL, FALSE
          172  +};
   164    173   
          174  +#ifndef NDEBUG
   165    175   #define winMemAssertMagic() assert( win_mem_data.magic==WINMEM_MAGIC )
          176  +#else
          177  +#define winMemAssertMagic()
          178  +#endif
          179  +
   166    180   #define winMemGetHeap() win_mem_data.hHeap
   167    181   
   168    182   static void *winMemMalloc(int nBytes);
   169    183   static void winMemFree(void *pPrior);
   170    184   static void *winMemRealloc(void *pPrior, int nBytes);
   171    185   static int winMemSize(void *p);
   172    186   static int winMemRoundup(int n);