/ History for src/malloc.c
Login

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

History for src/malloc.c

2020-07-16
14:19
[22d5bdd9] part of check-in [35cd8706] Small performance improvement and size reduction in sqlite3DbStrNDup(). (check-in: [35cd8706] user: drh branch: trunk, size: 24032)
2020-05-17
00:26
[d0400b03] part of check-in [1313557b] Use the sqlite3Realloc() interface internally, rather than the public sqlite3_realloc64() equivalent, to avoid unnecessary calls to sqlite3_initialize(). (check-in: [1313557b] user: drh branch: trunk, size: 24030)
2020-05-08
10:44
[167e9166] part of check-in [e9a8f910] Do not retry on a failed realloc() unless SQLITE_ENABLE_MEMORY_MANAGEMENT is available, meaning that the retry has some possibility of success. (check-in: [e9a8f910] user: drh branch: trunk, size: 24033)
2020-04-28
14:01
[a3e13b00] part of check-in [ce980af6] Use AtomicStore() when setting the mem0.nearlyFull boolean to avoid harmless TSAN warnings and to forestall doubts about threadsafety. (check-in: [ce980af6] user: drh branch: trunk, size: 23987)
11:45
[99898478] part of check-in [7556bc63] Use an AtomicLoad() macro in sqlite3HeapNearlyFull(). (check-in: [7556bc63] user: drh branch: trunk, size: 23950)
2020-03-30
13:35
[cabfef0d] part of check-in [a49f8ec5] Use __atomic_load_n() and __atomic_store_n() for a few more things where they are available. (check-in: [a49f8ec5] user: dan branch: trunk, size: 23937)
2019-12-31
15:12
[eaa4dc96] part of check-in [88d24498] Refactor names. Use "small" instead of "mini" to describe the smaller of the two lookaside memory allocation sizes. (check-in: [88d24498] user: drh branch: two-size-lookaside, size: 23911)
2019-12-13
15:48
[d74d986f] part of check-in [74805668] Cleanup and performance enhancements for mini-lookaside. (check-in: [74805668] user: drh branch: two-size-lookaside, size: 23847)
2019-12-12
20:58
[02235d03] part of check-in [e392e7f2] Reduce the number of call sites to dbMallocRawFinish in the case where n > lookaside.sz (check-in: [e392e7f2] user: numist branch: two-size-lookaside, size: 23209)
20:39
[cae32705] part of check-in [611020e3] Fix an issue where malloc could be used to fulfill a small allocation when a large lookaside slot could have beeen used instead. (check-in: [611020e3] user: numist branch: two-size-lookaside, size: 23212)
17:17
[8a907f9e] part of check-in [5e1949bc] Change the size of a mini-lookaside allocation to a macro (MINI_SZ) rather than a magic number (128). (check-in: [5e1949bc] user: drh branch: two-size-lookaside, size: 23179)
02:50
[350d345a] part of check-in [b02fdc09] More efficient implementation of a lookaside allocator that supports mini (in this case, harcoded to 128B) slots. (check-in: [b02fdc09] user: numist branch: two-size-lookaside, size: 23167)
2019-11-14
23:08
[b5acd8b5] part of check-in [ba27012d] Backport support for the sqlite3_hard_heap_limit64() interface and the hard_heap_limit pragma to the 3.30 branch. (check-in: [ba27012d] user: drh branch: branch-3.30, size: 22303)
17:46
[550021fc] part of check-in [33fd0c3a] Fix a bug in the hard_heap_limit pragma so that it returns the new value of the hard_heap_limit, not the soft_heap_limit. Change SQLITE_MAX_MEMORY so that it works by setting the default hard_heap_limit value. (check-in: [33fd0c3a] user: drh branch: hard-heap-limit, size: 22258)
15:21
[baf74e27] part of check-in [b8a631fd] Merge recent enhancements from trunk. (check-in: [b8a631fd] user: drh branch: hard-heap-limit, size: 22233)
2019-11-07
19:59
[70aae7cc] part of check-in [4ab9dbb9] Experimental branch to provide SQLITE_LIMIT_HEAP_K to limit the amount of allocated memory used by each database connection, individually. (check-in: [4ab9dbb9] user: drh branch: limit_heap_k, size: 21342)
2019-10-09
17:06
[7b36b39a] part of check-in [5ba8cee8] An alternative, experimental lookaside memory allocator that uses two different slot sizes. (check-in: [5ba8cee8] user: sperry branch: 2-size-lookaside, size: 20003)
2019-10-05
14:39
[b7640bcf] part of check-in [17ce1c49] Performance optimization to the lookaside-memory disabling mechanism. (check-in: [17ce1c49] user: drh branch: trunk, size: 20702)
2019-04-25
18:15
[224052e6] part of check-in [b0ccef61] Add the sqlite3_hard_heap_limit64() interface and the corresponding "PRAGMA hard_heap_limit=N" command. (check-in: [b0ccef61] user: drh branch: hard-heap-limit, size: 22278)
2019-02-08
14:55
[0f9da2a6] part of check-in [5c663804] Give the sqlite3 object a pointer to the current Parse so that if an OOM occurs, it can automatically set the Parse.rc value to SQLITE_NOMEM. This avoids a frequent extra test of db.mallocFailed in the innermost parser loop. (check-in: [5c663804] user: drh branch: trunk, size: 20747)
2018-01-10
13:58
[07295435] part of check-in [c42c734f] Tag an unreachable branch using ALWAYS(). (check-in: [c42c734f] user: drh branch: trunk, size: 20677)
2017-12-27
19:43
[6f684fd0] part of check-in [a8e1545c] Add and use the internal sqlite3DbSpanDup() interface. (check-in: [a8e1545c] user: drh branch: span-refactor, size: 20669)
2017-08-29
20:21
[a02c9e69] part of check-in [a06263f1] Faster memory allocation from lookaside by not trying to keep track of the number of outstanding allocations, and rather computing that value only when requested. (check-in: [a06263f1] user: drh branch: trunk, size: 20206)
2017-08-28
15:51
[e069cec0] part of check-in [54b00024] Remove the rarely-used scratch memory allocator. This makes the code smaller, faster, and easier to maintain. In place of the scratch allocator, add the SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite that large memory allocations should be avoided. (check-in: [54b00024] user: drh branch: trunk, size: 20223)
2017-08-27
10:55
[6bd9604e] part of check-in [c93298d5] Instrumentation and changes in an effort to reduce thread contention. (check-in: [c93298d5] user: drh branch: reduced-thread-contention, size: 25188)
2017-04-05
12:39
[e20bb2b4] part of check-in [ad90e8bb] Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases where we know that the argument to be freed is never NULL. (check-in: [ad90e8bb] user: drh branch: trunk, size: 24923)
2017-03-10
17:03
[89c98e36] part of check-in [f8560c60] Fix an error in the SQLITE_MAX_MEMORY implementation resulting from a bad merge. Update the OSSFuzz interface so that it times out after running the byte-code engine for 10 seconds. (check-in: [f8560c60] user: drh branch: trunk, size: 24671)
16:22
[e2b75576] part of check-in [eabd4ef4] Add the -DSQLITE_MAX_MEMORY=N compile-time option. The default is no limit. (check-in: [eabd4ef4] user: drh branch: trunk, size: 24660)
15:55
[96f86a14] part of check-in [77dfe2ab] Add the SQLITE_MAX_MEMORY compile-time option that provides a hard upper bound on the amount of memory that SQLite will use, per process. (check-in: [77dfe2ab] user: drh branch: max-memory-option, size: 24651)
2017-02-13
13:35
[d0a14742] part of check-in [670f10b2] Change all legacy instances of "#if SQLITE_DEBUG" to "#ifdef SQLITE_DEBUG" for consistency. (check-in: [670f10b2] user: drh branch: trunk, size: 24530)
2017-02-08
18:13
[f345c60d] part of check-in [c09dd5c0] Typo fixes in comment. No changes to code. (check-in: [c09dd5c0] user: mistachkin branch: trunk, size: 24524)
16:01
[dc2b84cd] part of check-in [77b470b0] Always invoke the xRoundup() method of the memory allocator before calling xMalloc(). (check-in: [77b470b0] user: drh branch: trunk, size: 24526)
2017-01-13
12:53
[fc1b9f44] part of check-in [8c85b8fd] Fix the build for SQLITE_ENABLE_MEMORY_MANAGEMENT. (check-in: [8c85b8fd] user: drh branch: trunk, size: 24174)
2017-01-10
16:09
[c36ef8fa] part of check-in [4209b89e] Avoid unnecessary calls to the xRoundup() method of the memory allocator when the soft heap limit is not set. (check-in: [4209b89e] user: drh branch: trunk, size: 24165)
2017-01-03
18:05
[254c1cf3] part of check-in [f69ce75b] Use the GCC built-in __sync_fetch_and_sub() to make the sqlite3StatusDown() routine atomic, and thereby avoid some mutexing. (check-in: [f69ce75b] user: drh branch: gnu-safe-math, size: 24355)
2016-12-27
12:08
[f3fad34c] part of check-in [2d71cbdf] Avoid a potential (harmless) signed integer overflow in memory usage accounting when calling sqlite3_realloc() to reduce the size of an allocation. (check-in: [2d71cbdf] user: drh branch: trunk, size: 24191)
2016-10-17
00:48
[5ee7c2d3] part of check-in [cda998f0] Small size reduction and performance increase in the string duplicator. (check-in: [cda998f0] user: drh branch: trunk, size: 24180)
2016-08-04
14:08
[218f1578] part of check-in [491f1ef3] Add extra logging calls to this branch. (check-in: [491f1ef3] user: dan branch: debug, size: 24283)
2016-02-13
23:43
[1443d1ad] part of check-in [6a9c4a3e] Enhance ability to debug out-of-memory errors. (check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 24225)
2016-02-06
19:48
[337e9808] part of check-in [2f7778e6] Make sure variable declarations occur at the beginning of blocks, even with SQLITE_DEBUG enabled. (check-in: [2f7778e6] user: drh branch: trunk, size: 24220)
2016-02-05
13:38
[55ebb170] part of check-in [0a802e96] Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majority cases where db is guaranteed to be not NULL. (check-in: [0a802e96] user: drh branch: oom-handling, size: 24125)
02:42
[92ca6e16] part of check-in [d94416dd] Further performance improvements that fall out of the mallocFailed changes. (check-in: [d94416dd] user: drh branch: oom-handling, size: 23785)
01:55
[65168ef9] part of check-in [c3ef0347] Improvements to the way that OOM errors are processed. (check-in: [c3ef0347] user: drh branch: oom-handling, size: 23548)
2016-01-20
03:36
[b67c26c3] part of check-in [ff8eadbe] Performance improvement in sqlite3DbMallocRaw(). (check-in: [ff8eadbe] user: drh branch: trunk, size: 22649)
2015-12-10
15:09
[8f787669] part of check-in [ad3124c8] Move pointer range comparisons into a macro, where they can be dealt with in a more portable way. (check-in: [ad3124c8] user: drh branch: stdint.h, size: 22447)
2015-10-26
12:55
[337bbe9c] part of check-in [a36b7fe9] Remove an unreachable branch in malloc.c. (check-in: [a36b7fe9] user: drh branch: trunk, size: 22425)
2015-10-15
17:21
[0a2e42b8] part of check-in [9ccf8f8d] Remove a superfluous conditional from the memory allocation initialization. (check-in: [9ccf8f8d] user: drh branch: trunk, size: 22433)
16:20
[3eb27dfe] part of check-in [cb65989b] Performance optimizations to the sqlite3MallocSize() by requiring the argument to always be non-NULL. (check-in: [cb65989b] user: drh branch: trunk, size: 22479)
15:28
[f2daeddf] part of check-in [6422d223] Change sqlite3StatusSet() into sqlite3StatusHighwater() so that only the highwater mark is recorded. This gives a small size reduction and performance improvement. (check-in: [6422d223] user: drh branch: trunk, size: 22461)
2015-09-25
16:29
[76c62c8e] part of check-in [2c57b2f3] Disable the SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS mechanism and replace it with SQLITE_TESTCTRL_BENIGN_MALLOC_CTRL, which gives better control. (check-in: [2c57b2f3] user: drh branch: malloc-testing, size: 22480)
2015-09-10
01:22
[3a37ce69] part of check-in [8250e2a4] No-op the sqlite3_memory_alarm() interface in a different way, that does not break legacy memory behavior. This is a re-do of check-in [5d3f5df4da9f40d5]. (check-in: [8250e2a4] user: drh branch: trunk, size: 22443)
2015-09-02
14:56
[021012e2] part of check-in [5d3f5df4] The sqlite3_memory_alarm() interface has been deprecated and undocumented for almost 8 years (since version 3.5.3). Change it into a no-op. (check-in: [5d3f5df4] user: drh branch: trunk, size: 22838)
2015-09-01
20:09
[7de3bb83] part of check-in [8a80967f] Small size reduction and performance increase in sqlite3DbMallocSize(). (check-in: [8a80967f] user: drh branch: trunk, size: 23663)
2015-07-04
18:15
[19461e15] part of check-in [dacb2a61] Preserve the number of requested PAGECACHE pages even if the memory pointer or size is zero. Enhance the pcache1.c header comment to explain the memory layout of a page cache line. (check-in: [dacb2a61] user: drh branch: trunk, size: 23663)
2015-06-30
03:13
[9be4e645] part of check-in [791b706e] Change sqlite3ApiExit() so that its first argument is never NULL. (check-in: [791b706e] user: drh branch: trunk, size: 23697)
2015-05-15
04:13
[908c780f] part of check-in [56ef98a0] Simplifications to error message processing. Fix a possible problem in error message formatting when vacuuming a database with a corrupt schema. (check-in: [56ef98a0] user: drh branch: trunk, size: 23792)
2015-05-10
02:01
[5bc15d52] part of check-in [8a0d5d5e] Fix the sqlite3_memory_used() and sqlite3_memory_highwater() interfaces so that they really do provide a 64-bit answer. (check-in: [8a0d5d5e] user: drh branch: trunk, size: 23984)
2015-03-26
17:04
[6a370b83] part of check-in [3e872011] Avoid leaving the malloc subsystem in a partially initialized state if the low-level initialization callback fails. (check-in: [3e872011] user: drh branch: trunk, size: 24148)
2015-03-23
17:25
[e818a0db] part of check-in [1ce8e8fa] Add the sqlite3_status64() interface. Make the new interface and the legacy sqlite3_status() both atomic and threadsafe. Check threadsafety using assert()s. (check-in: [1ce8e8fa] user: drh branch: status64, size: 24073)
2015-03-21
23:38
[13f3f1cd] part of check-in [9513dbd4] Fix harmless compiler warnings with MSVC when assert() and SQLITE_MEMDEBUG are both enabled. (check-in: [9513dbd4] user: mistachkin branch: trunk, size: 23922)
2014-11-04
14:22
[740db543] part of check-in [391c9b85] Change the definition of SQLITE_CONFIG_SCRATCH so that at most one scratch buffer is used per thread. Use the generic heap memory allocator for the WalIterator object when running a checkpoint. (check-in: [391c9b85] user: drh branch: trunk, size: 23890)
2014-10-24
00:35
[5e02eab3] part of check-in [c297a84b] Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in progress and is not yet completely functional. (check-in: [c297a84b] user: drh branch: api-armor, size: 24079)
2014-10-07
15:46
[3c3ac679] part of check-in [ca5b789e] Enhance (and fix) the MEMTYPE tags associated with heap memory allocations when SQLITE_MEMDEBUG is used. (check-in: [ca5b789e] user: drh branch: trunk, size: 23964)
2014-10-03
14:54
[7cf86b4f] part of check-in [440705b9] Update to requirements marks related to changes in the memory allocation interface and enhancement of the documentation regarding DEFAULT clauses in CREATE TABLE. (check-in: [440705b9] user: drh branch: trunk, size: 23885)
2014-09-18
21:25
[5bb99ee1] part of check-in [9c09ac35] Add the Mem.szMalloc element to the Mem object and use it to keep track of the size of the Mem.zMalloc allocation. (check-in: [9c09ac35] user: drh branch: trunk, size: 23859)
02:20
[4c1d5111] part of check-in [5192f964] Fix harmless warnings on 32-bit MSVC builds. (check-in: [5192f964] user: drh branch: trunk, size: 23799)
01:21
[c6dc1e15] part of check-in [163bfae8] Fix compiler warnings and change the nullMem structure initializer into a format that MSVC can understand. (check-in: [163bfae8] user: drh branch: micro-optimizations, size: 23775)
2014-09-09
17:27
[cc015821] part of check-in [94954850] Add new APIs that take 64-bit length parameters: sqlite3_malloc64(), sqlite3_realloc64(), sqlite3_bind_blob64(), sqlite3_bind_texte64(), sqlite3_result_blob64(), and sqlite3_result_texte64(). Internal memory allocation routines also now use 64-bit unsigned length parameters for safety. Also add the sqlite3_msize() interface. Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid a integer overflow problem. (check-in: [94954850] user: drh branch: 64-bit-lengths, size: 23758)
2014-08-23
20:25
[954de5f9] part of check-in [bd41d394] Faster implementation of the sqlite3ApiExit() routine. (check-in: [bd41d394] user: drh branch: trunk, size: 23353)
19:42
[06f85078] part of check-in [6da6f46d] Another memory allocator performance optimization. (check-in: [6da6f46d] user: drh branch: trunk, size: 23191)
19:04
[7f26fced] part of check-in [f83daa16] Changes to sqlite3ScratchMalloc() that make the entire memory allocation interface a little faster and about 100 bytes smaller. (check-in: [f83daa16] user: drh branch: trunk, size: 22999)
2014-08-22
18:00
[0a88a97f] part of check-in [cf561d1f] Split the sqlite3Error() routine into sqlite3Error() and sqlite3ErrorWithMsg(), for a slight size reduction and performance increase. (check-in: [cf561d1f] user: drh branch: trunk, size: 23066)
2014-05-19
19:26
[35ee353f] part of check-in [aa7e2041] Fix harmless compiler warnings in MSVC. (check-in: [aa7e2041] user: drh branch: safer-malloc, size: 23038)
15:16
[6a1fbdad] part of check-in [17349a49] Changes to help ensure that a multiplication does not overflow when computing the number of bytes needed for a memory allocation, and cause a malfunction. No problems existing problems were discovered. However, these changes should help to ensure that no problems arise in the future. (check-in: [17349a49] user: drh branch: safer-malloc, size: 23019)
2013-12-10
19:49
[0203ebce] part of check-in [48ecf187] Simplify and improve the performance of the sqlite3VdbeMemGrow() routine. (check-in: [48ecf187] user: drh branch: trunk, size: 23069)
2013-09-13
16:36
[543a8eb5] part of check-in [870c030b] Change the PRAGMA parser to use a binary search for the pragma name. Also: Minor performance enhancement to sqlite3DbFree() and to the token dequoter. (check-in: [870c030b] user: drh branch: trunk, size: 23070)
2012-07-19
20:27
[57121e3e] part of check-in [0a334441] Further tweaks to malloc paths. (check-in: [0a334441] user: dan branch: calloc, size: 24868)
2012-07-18
16:07
[9321b18a] part of check-in [defd828e] Remove another branch from the DbMalloc() paths. (check-in: [defd828e] user: dan branch: calloc, size: 24539)
11:28
[1deb02c0] part of check-in [75c095ee] Reorganize code to remove a few of the branches introduced into the critical sqlite3DbMallocXXX() path by the previous commit. (check-in: [75c095ee] user: dan branch: calloc, size: 24363)
2012-07-17
19:32
[e80dccc5] part of check-in [8752237d] Enhance the custom memory allocation interface to allow the user to specify a calloc() function. (check-in: [8752237d] user: dan branch: calloc, size: 23832)
2012-05-21
16:59
[fe085aa8] part of check-in [3869aef6] Make sure lookaside memory allocations are unusable after they are freed. (check-in: [3869aef6] user: drh branch: trunk, size: 23049)
2011-12-22
18:44
[758b53e4] part of check-in [a61786e7] Backport the fixes for Coverity-discovered problems in [1c27d84216], [676acce274], and [f9c4a7c8f4] from trunk to the 3.7.6 branch. (check-in: [a61786e7] user: drh branch: branch-3.7.6, size: 22902)
17:10
[15afac5e] part of check-in [676acce2] Check the return code from sqlite3_initialize() called from within sqlite3_soft_heap_limit64() and return an error from sqlite3_soft_heap_limit64() if sqlite3_initialize() fails. (check-in: [676acce2] user: drh branch: trunk, size: 22928)
2011-05-05
17:00
[591aedb2] part of check-in [8ba456ae] Fix a bug in memory usage tracking that was introduced by check-in [4e33a0eaf83922]. (check-in: [8ba456ae] user: drh branch: trunk, size: 22897)
2011-04-15
19:30
[74c740e8] part of check-in [7a085271] Remove stray semi-colon that MSVC complained about. (check-in: [7a085271] user: shaneh branch: trunk, size: 22897)
16:39
[d9cdb1fc] part of check-in [4e33a0ea] Changes to memory allocator usage tracking to delay the onset of integer overflow. (check-in: [4e33a0ea] user: drh branch: trunk, size: 22898)
2011-04-05
22:08
[788f2ed9] part of check-in [3eeb0ff7] Suppress many harmless compiler warnings, mostly signed/unsigned comparisons within asserts or unused parameters in extensions. (check-in: [3eeb0ff7] user: drh branch: trunk, size: 22871)
2010-12-20
15:51
[92d59a00] part of check-in [34613f1d] Add additional DBSTATUS options for measuring the hit and miss rates against the lookaside memory pool - information useful in tuning the lookaside size. Currently experimental pending analysis of performance impact. (check-in: [34613f1d] user: drh branch: experimental, size: 22864)
2010-10-04
14:11
[3d7284cd] part of check-in [cde62657] Warning cleanup from MSVC. (check-in: [cde62657] user: shaneh branch: trunk, size: 22710)
2010-09-28
14:26
[455f9d67] part of check-in [7be03ecc] Fix several harmless compiler warnings. (check-in: [7be03ecc] user: drh branch: trunk, size: 22703)
2010-09-15
17:54
[babecbdf] part of check-in [82268a2c] Added the sqlite3_soft_heap_limit64() interface. Deprecate the older sqlite3_soft_heap_limit() interface. (check-in: [82268a2c] user: drh branch: trunk, size: 22700)
2010-09-11
16:25
[579a6eee] part of check-in [f9b5c5cb] Fix a couple of incorrect evidence marks on malloc(). (check-in: [f9b5c5cb] user: drh branch: trunk, size: 22491)
16:15
[44a50eb1] part of check-in [42b4bf9e] Additional evidence marks on the malloc() implementation. Update the documentation to explain that mallocs are not necessarily 8-byte aligned if the SQLITE_4_BYTE_ALIGNED_MALLOC compile-time option is used. (check-in: [42b4bf9e] user: drh branch: trunk, size: 22491)
15:54
[ab48f494] part of check-in [305cc4e6] Add assert() statements to demonstrate that memory allocations are always aligned to an 8-byte boundary (unless SQLITE_4_BYTE_ALIGNED_MALLOC is defined). (check-in: [305cc4e6] user: drh branch: trunk, size: 22370)
2010-09-02
18:13
[e0e9ca16] part of check-in [5a959160] Fix an off-by-one error in the scratch memory allocator. (check-in: [5a959160] user: drh branch: trunk, size: 22242)
17:15
[2231edbd] part of check-in [2211486b] Use sqlite3_mutex_notheld() instead of !sqlite3_mutex_held() inside of assert() statements since the former works when mutexing is disabled while the latter does not. (check-in: [2211486b] user: drh branch: trunk, size: 22243)
10:08
[8b67cb6b] part of check-in [4f20f8ba] If MEM_STATUS is disabled, avoid holding the STATIC_MEM mutex when calling the user-defined xMalloc method. Holding the mutex causes problems for memsys3 and memsys5. (check-in: [4f20f8ba] user: dan branch: trunk, size: 22241)
2010-08-31
15:27
[d9fcf07f] part of check-in [53b0c03f] Add evidence mark comments to source code. Add additional information to the documentation of sqlite3_release_memory(). Fix a minor inefficiency in mem1.c that was discovered while writing requirements tests. (check-in: [53b0c03f] user: drh branch: trunk, size: 22115)
2010-08-27
17:16
[f34c9253] part of check-in [a3475ddf] Refactor the implementation of the scratch memory allocator. Add the SQLITE_TESTCTRL_SCRATCHMALLOC interface to facilitate testing. (check-in: [a3475ddf] user: drh branch: trunk, size: 21820)
12:21
[e81193f1] part of check-in [51049479] Remove unnecessary code from malloc.c. Enhance pcache1.c so that is tries to reuse existing pages, rather than create new pages, when SQLite is under memory pressure. "Memory pressure" means that SQLITE_CONFIG_PAGECACHE memory is nearly exhausted or sqlite3_soft_heap_limit() has been reached. (check-in: [51049479] user: drh branch: trunk, size: 21886)
2010-07-26
19:09
[19a46846] part of check-in [6df081ad] Fix a bug in the SQLITE_STATUS_MALLOC_COUNT counter. Add an ALWAYS() around a condition in the SQLITE_DBSTATUS_SCHEMA_USED logic that is always true. (check-in: [6df081ad] user: drh branch: trunk, size: 21724)
18:43
[52c19b9e] part of check-in [8f8e442b] Add the SQLITE_STATUS_MALLOC_COUNT option for sqlite3_status(). (check-in: [8f8e442b] user: drh branch: trunk, size: 21666)
14:47
[9d7dc6a5] part of check-in [72b84d06] Add virtual table test cases to dbstatus.test. (check-in: [72b84d06] user: dan branch: experimental, size: 21559)
11:07
[1cf0f2f4] part of check-in [629e38a8] Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). (check-in: [629e38a8] user: drh branch: experimental, size: 21517)
2010-07-25
02:39
[2e38fd5e] part of check-in [548bf3f7] Fixes to prior checkins so that they compile and run even if SQLITE_MEMDEBUG is not defined. (check-in: [548bf3f7] user: drh branch: malloc-enhancement, size: 28385)
02:12
[a7e805ed] part of check-in [da2f62c5] Further examples of using automatic deallocation to replace "delete" methods. (check-in: [da2f62c5] user: drh branch: malloc-enhancement, size: 28304)
2010-07-24
19:08
[4ab52050] part of check-in [e5ecb159] Additional malloc sanity changes. Use sqlite3MemLink() on Index.zColAff and Table.zColAff as a proof of concept. (check-in: [e5ecb159] user: drh branch: malloc-enhancement, size: 27753)
18:25
[2dbc7365] part of check-in [48ef221c] Add infrastructure to support a hierarchy of memory allocations with automatic deallocation of substructure. (check-in: [48ef221c] user: drh branch: malloc-enhancement, size: 27416)
16:34
[8394eba1] part of check-in [ac1f37a6] Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). (check-in: [ac1f37a6] user: drh branch: malloc-enhancement, size: 21367)
11:28
[d3211310] part of check-in [9aa30342] Experimental code to measure memory consumed by database schemas and prepared statements. (check-in: [9aa30342] user: dan branch: experimental, size: 21012)
2010-07-23
17:32
[f8b9bcd1] part of check-in [80db61ac] Strenghten an assert() in malloc.c that helps to ensure that allocated memory is freed by the appropriate routine. (check-in: [80db61ac] user: drh branch: trunk, size: 20833)
2010-06-26
20:25
[09c3777b] part of check-in [f149b498] Fix two asserts on the scratch allocator to allow for up to two outstanding scratch allocations per thread. (check-in: [f149b498] user: drh branch: trunk, size: 20788)
2010-03-12
16:32
[a08f16d1] part of check-in [c2af2164] Add assert()s to mem2.c (activated by SQLITE_MEMDEBUG) which verify that memory alloctions that might have come from lookaside are always freed using a lookaside-aware free routine. (check-in: [c2af2164] user: drh branch: trunk, size: 20766)
2009-11-10
01:30
[5fa17579] part of check-in [f6c045f6] Remove the obsolete "$Id:$" RCS identifier strings from the source code. (check-in: [f6c045f6] user: drh branch: trunk, size: 19921)
2009-10-26
22:08
[685561d2] part of check-in [1d64e945] Remove some obsolete code within #if 0 that was causing developer concern. (check-in: [1d64e945] user: drh branch: trunk, size: 19978)
2009-08-18
14:48
[b1725183] part of check-in [577bd6f1] Fix obscure issues with the memsys5 memory allocator. Arrange that the xRealloc() interface to memory allocators is only called with a value that has been through xRoundup(). (check-in: [577bd6f1] user: drh branch: trunk, size: 20030)
2009-08-17
13:42
[ae9fef00] part of check-in [98c49e61] Enhanced documentation and minor code tweaks in preparation for hardening the sqlite3_initialize/shutdown interfaces against initialization failures. (check-in: [98c49e61] user: drh branch: trunk, size: 20075)
2009-07-17
11:44
[561710bf] part of check-in [fb1b955d] Code simplifications in support of structural testing. (CVS 6900) (check-in: [fb1b955d] user: drh branch: trunk, size: 20039)
2009-07-16
18:21
[70d22628] part of check-in [94525179] Code simplifications and comment improvements in support of structural coverage testing. (CVS 6899) (check-in: [94525179] user: drh branch: trunk, size: 20073)
2009-06-27
00:48
[16907f3b] part of check-in [653df0af] Fix a bug in sqlite3_realloc() - if called with a size of more than 2147483392 it returns 0 but it also releases the prior allocation. (CVS 6827) (check-in: [653df0af] user: drh branch: trunk, size: 20147)
2009-06-26
18:35
[55c4e997] part of check-in [0d345e59] Remove incorrect NEVER() macros from malloc.c. The allocations can be exceeded using sqlite3_malloc() and sqlite3_realloc(). (CVS 6826) (check-in: [0d345e59] user: drh branch: trunk, size: 20123)
2009-05-03
20:23
[7b3b6423] part of check-in [a6122990] Changes to facility full coverage testing of util.c. (CVS 6597) (check-in: [a6122990] user: drh branch: trunk, size: 20337)
2009-03-24
15:08
[a1f0f8ae] part of check-in [ea74d8dc] Changes to insure that lookaside memory allocations are never used to hold schema content. Ticket #3743. (CVS 6377) (check-in: [ea74d8dc] user: drh branch: trunk, size: 20365)
2009-03-23
17:49
[1d862da7] part of check-in [8a9f3e66] Add asserts to make sure that database connection locks are held when accessing the lookaside memory allocation buffers. No defects were found. (CVS 6374) (check-in: [8a9f3e66] user: drh branch: trunk, size: 20339)
04:33
[1a52c55b] part of check-in [db1d4d2f] Use the ROUND8() macro to round an integer up to the nearest multiple of 8 and ROUNDDOWN8() macro to round down to the nearest multiple of 8. This is a cosmetic change. (CVS 6372) (check-in: [db1d4d2f] user: danielk1977 branch: trunk, size: 20155)
2009-03-05
04:20
[b9c59b33] part of check-in [6404afa0] Corrected typos and misspellings. Ticket #3702. (CVS 6336) (check-in: [6404afa0] user: shane branch: trunk, size: 20139)
2009-02-19
20:50
[072ddad9] part of check-in [e1ad757e] Remove code in malloc.c that was already commented out using #if 0. (CVS 6306) (check-in: [e1ad757e] user: drh branch: trunk, size: 20135)
2009-02-17
18:37
[552d993e] part of check-in [f6ba7bb9] Add tests to double-check that nothing within SQLite ever tries to allocate amounts of memory that are close to the maximum signed integer, leading to an integer overflow within malloc(). This is not currently a problem. The extra tests just insure it never becomes a problem. (CVS 6298) (check-in: [f6ba7bb9] user: drh branch: trunk, size: 23130)
16:29
[836bc7ea] part of check-in [79431c58] Allow sqlite3_shutdown() to be called by a process before sqlite3_initialize() is. Prior to this commit such a call could segfault. (CVS 6296) (check-in: [79431c58] user: danielk1977 branch: trunk, size: 22430)
2009-01-20
16:53
[bc408056] part of check-in [1041abd6] When not compiling for an EBCDIC system, use built-in alternatives to the tolowe r(), toupper() and other ctype.h library functions. Ticket #3597. (CVS 6196) (check-in: [1041abd6] user: danielk1977 branch: trunk, size: 22383)
2008-12-16
17:20
[e2b4e6d7] part of check-in [8b8f6a6a] Fix a compile error in an assert() and a warning with MSVC builds. (CVS 6032) (check-in: [8b8f6a6a] user: shane branch: trunk, size: 22396)
13:46
[a0bd0c11] part of check-in [13b56b7f] Make sure the memory returned from sqlite3ScratchMalloc() is 8-byte aligned. Ticket #3542. (CVS 6031) (check-in: [13b56b7f] user: drh branch: trunk, size: 22391)
2008-12-10
21:19
[1e5eeb5a] part of check-in [ea01d437] Additional work at eliminating silly compiler warnings. (CVS 6010) (check-in: [ea01d437] user: drh branch: trunk, size: 22306)
19:26
[6a5b9115] part of check-in [c872d554] Never use strlen(). Use our own internal sqlite3Strlen30() which is guaranteed to never overflow an integer. Additional explicit casts to avoid nuisance warning messages. (CVS 6007) (check-in: [c872d554] user: drh branch: trunk, size: 22289)
2008-12-05
15:24
[89c7c58f] part of check-in [46f2d089] Make use of sqlite3DbMallocSize to maximize the size of growable buffers after each reallocation. Added new comments and testcase() macros to where.c. (CVS 5981) (check-in: [46f2d089] user: drh branch: trunk, size: 22250)
2008-11-19
09:05
[4e7bf5a3] part of check-in [88134322] Changes to avoid "unused parameter" compiler warnings. (CVS 5921) (check-in: [88134322] user: danielk1977 branch: trunk, size: 22224)
2008-11-18
07:27
[00532787] part of check-in [d68e2795] Reduce the number of "missing initializer" warnings. (CVS 5915) (check-in: [d68e2795] user: danielk1977 branch: trunk, size: 22158)
2008-11-17
19:18
[4a12eb37] part of check-in [8009220c] Modifications to avoid unsigned/signed comparisons in various files. (CVS 5914) (check-in: [8009220c] user: danielk1977 branch: trunk, size: 22134)
2008-10-12
00:27
[a213fb46] part of check-in [ba3711ac] Added SQLITE_OMIT_DEPRECATED compile time option to leave out deprecated functions. Updated test scripts to skip tests of deprecated functions if they are compiled out. (CVS 5808) (check-in: [ba3711ac] user: shane branch: trunk, size: 22123)
2008-10-11
17:35
[08f39c0f] part of check-in [63dd8be7] Fix to sqlite3DbMallocRaw() when SQLITE_OMIT_LOOKASIDE is defined so that once it fails it continues to fail. Add a comment explaining why this is important. (CVS 5804) (check-in: [63dd8be7] user: drh branch: trunk, size: 22083)
15:38
[20613ebf] part of check-in [0c4c6607] Added an assert() to detect lookaside memory leaks. Also added the SQLITE_OMIT_LOOKASIDE compile-time option which is useful in trying to track down lookaside memory leaks. (CVS 5800) (check-in: [0c4c6607] user: drh branch: trunk, size: 21393)
2008-09-23
16:41
[31f4ca21] part of check-in [046ef072] Always transform error code SQLITE_IOERR_NOMEM to SQLITE_NOMEM before returning. This was already happening in most places. (CVS 5738) (check-in: [046ef072] user: danielk1977 branch: trunk, size: 21294)
2008-09-04
04:32
[6c3bcae8] part of check-in [821c387d] Modified core to not call deprecated functions sqlite3_memory_alarm() and sqlite3_transfer_bindings() by adding sqlite3MemoryAlarm() and sqlite3TransferBindings(). sqlite3_memory_alarm() and sqlite3_transfer_bindings() are now simple wrappers for the new functions. In prep for adding SQLITE_OMIT_DEPRECATED. (CVS 5672) (check-in: [821c387d] user: shane branch: trunk, size: 21260)
2008-09-02
17:52
[9aa2ef80] part of check-in [88bfdc87] Explicitly initialize at least the first field of every struct. This is to work around compilers that don't like the syntax "struct XXX { ... } yyy = {};". (CVS 5666) (check-in: [88bfdc87] user: danielk1977 branch: trunk, size: 20981)
10:22
[fb23bfbc] part of check-in [46acaf58] Change some more global variables to work with OMIT_WSD. (CVS 5660) (check-in: [46acaf58] user: danielk1977 branch: trunk, size: 20971)
2008-09-01
18:34
[2ffd62fb] part of check-in [573d92ab] Begin adding support for the SQLITE_OMIT_WSD macro. Some (many) WSD variables still need wrappers added to them. (CVS 5652) (check-in: [573d92ab] user: danielk1977 branch: trunk, size: 20898)
2008-08-29
17:56
[6bd94746] part of check-in [4e011ddf] Move a call to sqlite3_mutex_leave() to protect calls to sqlite3StatusAdd() related to scratch (SQLITE_CONFIG_SCRATCH) memory. (CVS 5641) (check-in: [4e011ddf] user: danielk1977 branch: trunk, size: 20436)
2008-08-21
12:19
[7ccc630b] part of check-in [d025866b] Fix the functionality associated with sqlite3_release_memory() and sqlite3_soft_heap_limit(). It is automatically disabled if the SQLITE_CONFIG_PAGECACHE option is used. (CVS 5576) (check-in: [d025866b] user: danielk1977 branch: trunk, size: 20436)
2008-08-20
14:49
[56918cdd] part of check-in [cb494e10] Add the pcache module from the experimental branch. Also change things so that most of the built-in SQL functions are kept in single static hash-table, rather than creating and populating a separate hash table for each open database connection. (CVS 5566) (check-in: [cb494e10] user: danielk1977 branch: trunk, size: 20409)
2008-08-05
17:53
[22c68fc6] part of check-in [c4e9b824] Add SQLITE_STATUS_PAGECACHE_SIZE and SQLITE_STATUS_SCRATCH_SIZE. (CVS 5537) (check-in: [c4e9b824] user: drh branch: trunk, size: 20388)
2008-08-01
16:31
[f0ad2800] part of check-in [6a6b9430] Test cases for sqlite3_db_config() and sqlite3_db_status(). (CVS 5518) (check-in: [6a6b9430] user: drh branch: trunk, size: 20168)
2008-07-31
17:16
[b1a337e2] part of check-in [e7ed0fe6] Change the definition of SQLITE_CONFIG_PAGECACHE and SQLITE_CONFIG_SCRATCH to omit the magic "+4" in the buffer size calculation. (CVS 5512) (check-in: [e7ed0fe6] user: drh branch: trunk, size: 20167)
2008-07-29
14:29
[9359e52a] part of check-in [0ce39c21] Enhancements to the pagecache malloc test configuration. Changes to the speed test scripts to use the new test enhancements. (CVS 5494) (check-in: [0ce39c21] user: drh branch: trunk, size: 19976)
2008-07-28
19:34
[2aa685ca] part of check-in [e48f9697] Implement the "lookaside" memory allocation cache. Use of this cache makes the speed1.test script run about 15% faster. Added new interfaces to control the cache. (CVS 5488) (check-in: [e48f9697] user: drh branch: trunk, size: 19965)
2008-07-18
18:56
[c4b52589] part of check-in [5c22132e] Use the actual size of memory allocations to update the memory status counters. Fix the roundup() function of mem3 to be much closer to the actual allocation size. Ticket #3226. (CVS 5440) (check-in: [5c22132e] user: drh branch: trunk, size: 18787)
2008-07-14
12:38
[b9ff4e02] part of check-in [518a24aa] Fix a bug introduced by check-in (5406). Ticket #3216. (CVS 5407) (check-in: [518a24aa] user: drh branch: trunk, size: 18704)
12:30
[3c11d9c2] part of check-in [2c24e50d] Work around a bug in Borland C. Ticket #3216. (CVS 5406) (check-in: [2c24e50d] user: drh branch: trunk, size: 18703)
2008-07-08
19:34
[226a532e] part of check-in [8ed04b1e] Completely rework the sqlite3SetString() primitive so that it honors the SQLITE_LIMIT_LENGTH and avoids the use of strlen(). (CVS 5374) (check-in: [8ed04b1e] user: drh branch: trunk, size: 18536)
2008-06-23
14:03
[f52166df] part of check-in [e6ea8f87] Fix some codewarrior compilation problems. (CVS 5278) (check-in: [e6ea8f87] user: danielk1977 branch: trunk, size: 19003)
11:11
[a3c5f9bf] part of check-in [32404468] Correct comments above sqlite3_release_memory() and sqlite3_soft_heap_limit(). Ticket #3138. (CVS 5275) (check-in: [32404468] user: danielk1977 branch: trunk, size: 18979)
2008-06-21
08:12
[d4339af3] part of check-in [3d413e9b] Fix a problem in the test suite that could cause a crash if using a pre-allocated block of memory for pages (the problem was that sqlite3_shutdown() was being called while there were still open database connections). (CVS 5259) (check-in: [3d413e9b] user: danielk1977 branch: trunk, size: 18862)
2008-06-19
18:17
[66c0b17a] part of check-in [d22cd2a5] Move the malloc() failure simulation out of malloc.c and into a separate sqlite3_mem_methods interface. Still some related changes to come. (CVS 5250) (check-in: [d22cd2a5] user: danielk1977 branch: trunk, size: 18158)
00:16
[33b8a206] part of check-in [cb1f11cd] Add some test logic to the new memory allocation subsystem. (Lots more needed.) The test suite is currently indicating memory leaks, though it is unclear if this is a true code problem or just an instrumentation problem. (CVS 5240) (check-in: [cb1f11cd] user: drh branch: trunk, size: 18432)
2008-06-18
18:12
[56e48f81] part of check-in [383a7860] Added support for scratch-memory lookaside allocations. Largely untested. Added calls to sqlite3_initialize() within malloc APIs. (CVS 5237) (check-in: [383a7860] user: drh branch: trunk, size: 15643)
17:09
[6f84f295] part of check-in [5059644c] Implement the 'CONFIG_SINGLETHREAD' and 'CONFIG_MULTITHREAD' configuration modes. (CVS 5234) (check-in: [5059644c] user: danielk1977 branch: trunk, size: 13403)
2008-06-17
15:12
[7b622d22] part of check-in [3e797d0f] Add internal interfaces: PageMalloc/PageFree and ScratchMalloc/ScratchFree. (CVS 5226) (check-in: [3e797d0f] user: drh branch: trunk, size: 13425)
2008-06-15
02:51
[c5bdf896] part of check-in [65fe7b62] Continuing work on the new memory allocation subsystem. Added routines for temporary memory allocation. Right the btree balance mechanism to only do one temporary allocation at a time. (CVS 5220) (check-in: [65fe7b62] user: drh branch: trunk, size: 13216)
2008-06-14
16:56
[ed5c3658] part of check-in [f00305f4] Continuing progress on the new memory allocation subsystem. Added the sqlite3_mem_methods structure for defining new memory allocators at run-time. (CVS 5219) (check-in: [f00305f4] user: drh branch: trunk, size: 11791)
2008-03-26
18:34
[12c1ae98] part of check-in [8c2f6952] Changes to delay freeing buffers associated with vdbe memory cells until either sqlite3_finalize() or sqlite3_release_memory() is called. (CVS 4922) (check-in: [8c2f6952] user: danielk1977 branch: trunk, size: 5871)
2007-10-20
16:36
[60e392a4] part of check-in [b58c2b37] Add the new memory allocator to the amalgamation. Improvements to out-of-memory handling. (CVS 4498) (check-in: [b58c2b37] user: drh branch: trunk, size: 5800)
2007-08-29
14:06
[de4e77fe] part of check-in [c790c234] Use the DbMalloc() and DbRealloc() functions more consistently. (CVS 4323) (check-in: [c790c234] user: danielk1977 branch: trunk, size: 5810)
12:31
[baed31e1] part of check-in [e38ef81b] Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321) (check-in: [e38ef81b] user: danielk1977 branch: trunk, size: 5671)
2007-08-24
03:51
[d4282f50] part of check-in [3a68fcdd] The win32 driver compiles but does not yet work well. Many bugs fixed. (CVS 4282) (check-in: [3a68fcdd] user: drh branch: trunk, size: 5197)
2007-08-22
20:18
[8078d4c3] part of check-in [db818430] The malloc.test script now passes all tests with no errors. (CVS 4271) (check-in: [db818430] user: drh branch: trunk, size: 5207)
00:39
[f5ace943] part of check-in [1914044b] Reenable the memory management logic. The quick.test script now runs with SQLITE_MEMDEBUG and SQLITE_ENABLE_MEMORY_MANAGEMENT. 7 minor errors. (CVS 4265) (check-in: [1914044b] user: drh branch: trunk, size: 5200)
2007-08-21
19:33
[c291b07b] part of check-in [92872761] The sqlite3_value object now carries an sqlite3* pointer to use for recording malloc failures. This eliminates the need to pass sqlite3* pointers into many internal interfaces. Also added more mutexing. (CVS 4263) (check-in: [92872761] user: drh branch: trunk, size: 5238)
10:44
[c2f5da62] part of check-in [fbbd5bda] Remove unnecessary #includes of "os.h". New mutex implementations. (CVS 4255) (check-in: [fbbd5bda] user: drh branch: trunk, size: 5326)
2007-08-16
10:09
[613c65f1] part of check-in [77b16713] More work on refactoring of malloc() interfaces. There are still many errors. (CVS 4233) (check-in: [77b16713] user: danielk1977 branch: trunk, size: 5350)
04:30
[bec719bd] part of check-in [deb7ecd6] Half-way through a major refactoring of the memory allocation. I have not even attempted to compile so I am certain there are countless errors. (CVS 4231) (check-in: [deb7ecd6] user: drh branch: trunk, size: 4863)
2007-08-08
01:04
[3850ab4a] part of check-in [c09ec102] Additional refinements on the amalgamation: Give a couple of constants file scope and add the SQLITE_API prefix to some interfaces that need it. Ticket #2554. (CVS 4199) (check-in: [c09ec102] user: drh branch: trunk, size: 24424)
2007-06-15
20:29
[fa9bbccc] part of check-in [7d3c1f08] Make arrangements to optionally print a debug message at the point of a simulated malloc() failure when SQLITE_MEMDEBUG is defined. (CVS 4077) (check-in: [7d3c1f08] user: drh branch: trunk, size: 24428)
2007-05-16
17:28
[07790014] part of check-in [93f811ec] Change a few selected functions to macros to speed things up. (CVS 4015) (check-in: [93f811ec] user: danielk1977 branch: trunk, size: 24260)
2007-05-05
11:48
[b89e3125] part of check-in [16041116] Refactoring. Split btreeInt.h off from btree.c. Split malloc.c off from util.c. Expect much more to follow. (CVS 3925) (check-in: [16041116] user: drh branch: trunk, size: 24432) Added