System.Data.SQLite
Check-in [d79035292c]
Not logged in

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

Overview
Comment:When compiled with SQLITE_STANDARD and TRACK_MEMORY_BYTES, the SQLiteMemory class should track the number of allocations, not sizes in bytes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d79035292cc26714de53595f5415f1ca06f2f40b
User & Date: mistachkin 2013-07-03 00:38:21
Context
2013-07-03
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
00:31
Fix typo. Add private CopyNativeModule method for future use. check-in: 3a36c22148 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteModule.cs.

3449
3450
3451
3452
3453
3454
3455


3456
3457
3458
3459
3460
3461
3462
        /// The actual size, in bytes, of the memory block specified via the
        /// native pointer.
        /// </returns>
        public static int Size(IntPtr pMemory)
        {
#if !SQLITE_STANDARD
            return UnsafeNativeMethods.sqlite3_malloc_size_interop(pMemory);


#else
            return 0;
#endif
        }

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








>
>







3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
        /// The actual size, in bytes, of the memory block specified via the
        /// 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
        }

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