System.Data.SQLite

Check-in [6669e5169f]
Login

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

Overview
Comment:When compiled with SQLITE_STANDARD and TRACK_MEMORY_BYTES, check if the pointer is valid prior to returning 1.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6669e5169f569b5d092e5ea2fe919561b9149cc0
User & Date: mistachkin 2013-07-03 03:59:52.317
Context
2013-07-03
04:26
Update MSVC 2012 runtimes in externals. Update master release archive manifest. check-in: 01feb27e57 user: mistachkin tags: trunk
03:59
When compiled with SQLITE_STANDARD and TRACK_MEMORY_BYTES, check if the pointer is valid prior to returning 1. check-in: 6669e5169f user: mistachkin tags: trunk
00:38
When compiled with SQLITE_STANDARD and TRACK_MEMORY_BYTES, the SQLiteMemory class should track the number of allocations, not sizes in bytes. check-in: d79035292c user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteModule.cs.
3450
3451
3452
3453
3454
3455
3456


3457


3458
3459
3460
3461
3462
3463
3464
        /// native pointer.
        /// </returns>
        public static int Size(IntPtr pMemory)
        {
#if !SQLITE_STANDARD
            return UnsafeNativeMethods.sqlite3_malloc_size_interop(pMemory);
#elif TRACK_MEMORY_BYTES


            return 1; /* HACK: Track number of allocations, not bytes. */


#else
            return 0;
#endif
        }

        ///////////////////////////////////////////////////////////////////////








>
>
|
>
>







3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
        /// native pointer.
        /// </returns>
        public static int Size(IntPtr pMemory)
        {
#if !SQLITE_STANDARD
            return UnsafeNativeMethods.sqlite3_malloc_size_interop(pMemory);
#elif TRACK_MEMORY_BYTES
            //
            // HACK: Ok, we cannot determine the size of the memory block;
            //       therefore, just track number of allocations instead.
            //
            return (pMemory != IntPtr.Zero) ? 1 : 0;
#else
            return 0;
#endif
        }

        ///////////////////////////////////////////////////////////////////////