drh
592f0cb15e
Avoid leaving the malloc subsystem in a partially initialized state if
...
the low-level initialization callback fails.
FossilOrigin-Name: 3e872011ff5e27738c282f46d2b5803d94fe4b76
2015-03-26 17:04:23 +00:00
drh
af89fe66ea
Add the sqlite3_status64() interface. Make the new interface and the legacy
...
sqlite3_status() both atomic and threadsafe. Check threadsafety using
assert()s.
FossilOrigin-Name: 1ce8e8fa4b866aafa12b1da0eb4d02321af9293e
2015-03-23 17:25:18 +00:00
mistachkin
d425864d33
Fix harmless compiler warnings with MSVC when assert() and SQLITE_MEMDEBUG are both enabled.
...
FossilOrigin-Name: 9513dbd4860c8dd391f831982d09aff227d16f5c
2015-03-21 23:38:59 +00:00
drh
cbd55b0362
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.
FossilOrigin-Name: 391c9b85abcb5ba300fb2e116384639310c69ed2
2014-11-04 14:22:27 +00:00
drh
d231aa3a42
Enhance (and fix) the MEMTYPE tags associated with heap memory allocations
...
when SQLITE_MEMDEBUG is used.
FossilOrigin-Name: ca5b789e33c4e5ce366d8f5372d086442f84e230
2014-10-07 15:46:54 +00:00
drh
8da47419dd
Update to requirements marks related to changes in the memory allocation
...
interface and enhancement of the documentation regarding DEFAULT clauses
in CREATE TABLE.
FossilOrigin-Name: 440705b98a3429b830ea85e71cc1e414bc6d8058
2014-10-03 14:54:47 +00:00
drh
17bcb10299
Add the Mem.szMalloc element to the Mem object and use it to keep track of
...
the size of the Mem.zMalloc allocation.
FossilOrigin-Name: 9c09ac353df6041808cace41880f4729ee73f5e1
2014-09-18 21:25:33 +00:00
drh
20f3df046a
Fix harmless warnings on 32-bit MSVC builds.
...
FossilOrigin-Name: 5192f964b2a85459553f1cea741b9791606ccc4e
2014-09-18 02:20:54 +00:00
drh
3329a63ac5
Fix compiler warnings and change the nullMem structure initializer into a
...
format that MSVC can understand.
FossilOrigin-Name: 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
2014-09-18 01:21:43 +00:00
drh
da4ca9d19c
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.
FossilOrigin-Name: 94954850cf2e1ec0b7f590c7f46cdc54c72558ce
2014-09-09 17:27:35 +00:00
drh
b50c65d561
Faster implementation of the sqlite3ApiExit() routine.
...
FossilOrigin-Name: bd41d394d48516eb7d8ddc46abdcb427aa80173e
2014-08-23 20:25:53 +00:00
drh
b4586f1254
Another memory allocator performance optimization.
...
FossilOrigin-Name: 6da6f46d0c43e3b68c21f514ddf8ee663c20f249
2014-08-23 19:42:06 +00:00
drh
3ccd5bf89e
Changes to sqlite3ScratchMalloc() that make the entire memory allocation
...
interface a little faster and about 100 bytes smaller.
FossilOrigin-Name: f83daa16f65ef35062412e88c214852a4aeb3da2
2014-08-23 19:04:55 +00:00
drh
13f40da31d
Split the sqlite3Error() routine into sqlite3Error() and
...
sqlite3ErrorWithMsg(), for a slight size reduction and performance increase.
FossilOrigin-Name: cf561d1f0bb60b3d638632d20bd686dda4fa4a04
2014-08-22 18:00:11 +00:00
drh
b0e7704e9f
Simplify and improve the performance of the sqlite3VdbeMemGrow() routine.
...
FossilOrigin-Name: 48ecf18774ba9572d86696c60d87007a619d9f53
2013-12-10 19:49:00 +00:00
drh
9ccd8659ff
Change the PRAGMA parser to use a binary search for the pragma name.
...
Also: Minor performance enhancement to sqlite3DbFree() and to the
token dequoter.
FossilOrigin-Name: 870c030b4e1854e6e0d39907fadbd82774c16f56
2013-09-13 16:36:46 +00:00
drh
3608f177ba
Make sure lookaside memory allocations are unusable after they are freed.
...
FossilOrigin-Name: 3869aef6348018f584137f36f6924193a790e52f
2012-05-21 16:59:16 +00:00
drh
de0f18154e
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.
FossilOrigin-Name: 676acce274fec692a1eb34d27ee4b1327b4b3334
2011-12-22 17:10:35 +00:00
drh
2e5a422eee
Fix a bug in memory usage tracking that was introduced by
...
check-in [4e33a0eaf83922].
FossilOrigin-Name: 8ba456ae0b3d0c0b6f72f98bd0bc28f72dfa4ff5
2011-05-05 17:00:51 +00:00
shaneh
ca591feb34
Remove stray semi-colon that MSVC complained about.
...
FossilOrigin-Name: 7a085271ff85033479c2057c19a45a750168d228
2011-04-15 19:30:42 +00:00
drh
8e1bb041a8
Changes to memory allocator usage tracking to delay the onset of integer
...
overflow.
FossilOrigin-Name: 4e33a0eaf83922926f8d5ee988a20439a09bc795
2011-04-15 16:39:52 +00:00
drh
fcd71b6010
Suppress many harmless compiler warnings, mostly signed/unsigned comparisons
...
within asserts or unused parameters in extensions.
FossilOrigin-Name: 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81
2011-04-05 22:08:24 +00:00
drh
0b12e7f860
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.
FossilOrigin-Name: 34613f1dc54c638531ca2f5907b71fbe8841233e
2010-12-20 15:51:58 +00:00
shaneh
4b03f21e4f
Warning cleanup from MSVC.
...
FossilOrigin-Name: cde62657d6f410a3d6899cd7b4000d276fe3c813
2010-10-04 14:11:54 +00:00
drh
6ac78a0d9f
Fix several harmless compiler warnings.
...
FossilOrigin-Name: 7be03ecc04235420e54fed8a88742243278de160
2010-09-28 14:26:36 +00:00
drh
f82ccf6437
Added the sqlite3_soft_heap_limit64() interface. Deprecate the older
...
sqlite3_soft_heap_limit() interface.
FossilOrigin-Name: 82268a2c3d75431cd40de6ad09d398729de32a29
2010-09-15 17:54:31 +00:00
drh
39f67bebdd
Fix a couple of incorrect evidence marks on malloc().
...
FossilOrigin-Name: f9b5c5cb135f3d0bb2b64b4d3f8d77bbd8d2ae98
2010-09-11 16:25:42 +00:00
drh
71a1a0f485
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.
FossilOrigin-Name: 42b4bf9e72501cf228b4086437c7660443933f74
2010-09-11 16:15:55 +00:00
drh
1567acf96a
Add assert() statements to demonstrate that memory allocations are always
...
aligned to an 8-byte boundary (unless SQLITE_4_BYTE_ALIGNED_MALLOC is defined).
FossilOrigin-Name: 305cc4e6c1164b1ede0c3177e3c0f9b8644df0f6
2010-09-11 15:54:53 +00:00
drh
7ff2719e88
Fix an off-by-one error in the scratch memory allocator.
...
FossilOrigin-Name: 5a9591607a0a5ba4527bf2a90179651053244953
2010-09-02 18:13:00 +00:00
drh
1ff6e3ab89
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.
FossilOrigin-Name: 2211486b69cf53f5efb1334aff8b403b26596102
2010-09-02 17:15:19 +00:00
dan
b0c6a8884b
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.
...
FossilOrigin-Name: 4f20f8ba73691c8a1dc33d2fcd1e793dd08f00a8
2010-09-02 10:08:41 +00:00
drh
9f129f467e
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.
FossilOrigin-Name: 53b0c03fd33d2d8141fd386de5493fec64456042
2010-08-31 15:27:32 +00:00
drh
badc980afa
Refactor the implementation of the scratch memory allocator. Add the
...
SQLITE_TESTCTRL_SCRATCHMALLOC interface to facilitate testing.
FossilOrigin-Name: a3475ddfbe4526e6e0b334fd1376ee7c31508b80
2010-08-27 17:16:44 +00:00
drh
50d1b5f363
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.
FossilOrigin-Name: 51049479a8577e03cc353f71f6e13a10c8323d91
2010-08-27 12:21:06 +00:00
drh
81ba7d16b7
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.
FossilOrigin-Name: 6df081adbfa581c477bd2c96bb3f7f44be131a8f
2010-07-26 19:09:31 +00:00
drh
eafc43b156
Add the SQLITE_STATUS_MALLOC_COUNT option for sqlite3_status().
...
FossilOrigin-Name: 8f8e442b3af553753e25c304efa289b626e3a227
2010-07-26 18:43:40 +00:00
dan
ccd4ad3e6c
Add virtual table test cases to dbstatus.test.
...
FossilOrigin-Name: 72b84d066a4eac90a77142c3ea66ef3d21a1104e
2010-07-26 14:47:14 +00:00
drh
174b9a166d
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree()
...
and all memory from sqlite3_malloc() is freed by sqlite3_free().
FossilOrigin-Name: 629e38a8c9e31111e351fe4625a5835576d23584
2010-07-26 11:07:20 +00:00
drh
b975598ea0
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and
...
all memory from sqlite3_malloc() is freed by sqlite3_free().
FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
2010-07-24 16:34:37 +00:00
dan
d46def77db
Experimental code to measure memory consumed by database schemas and prepared statements.
...
FossilOrigin-Name: 9aa30342f4de4eff630520ea8e07ad253d3f0877
2010-07-24 11:28:28 +00:00
drh
7c2ed2ac25
Strenghten an assert() in malloc.c that helps to ensure that allocated memory
...
is freed by the appropriate routine.
FossilOrigin-Name: 80db61acca034a8edff0fd23a65a0bbc9206a7b3
2010-07-23 17:32:23 +00:00
drh
37f9918758
Fix two asserts on the scratch allocator to allow for up to two outstanding
...
scratch allocations per thread.
FossilOrigin-Name: f149b498b6ada3fc9f71ee104c351554c80c7f8a
2010-06-26 20:25:30 +00:00
drh
107b56e86d
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.
FossilOrigin-Name: c2af2164cf7b279ebb3e08201561348be6e765df
2010-03-12 16:32:53 +00:00
drh
c81c11f62c
Remove the obsolete "$Id:$" RCS identifier strings from the source code.
...
FossilOrigin-Name: f6c045f649036958078cb15cd9d5453680c82b0c
2009-11-10 01:30:52 +00:00
drh
40f75cf389
Remove some obsolete code within #if 0 that was causing developer concern.
...
FossilOrigin-Name: 1d64e9453fb59d2bb1b5cb0cbacaf135b8f928c3
2009-10-26 22:08:21 +00:00
drh
7c6791c8b1
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().
FossilOrigin-Name: 577bd6f15556b7f6d86ee5167353fdd535577bf6
2009-08-18 14:48:53 +00:00
drh
9ac06509f1
Enhanced documentation and minor code tweaks in preparation for hardening
...
the sqlite3_initialize/shutdown interfaces against initialization failures.
FossilOrigin-Name: 98c49e6135ae6268a80de88f8b0284f88ef32e1d
2009-08-17 13:42:29 +00:00
drh
f18a61dd59
Code simplifications in support of structural testing. (CVS 6900)
...
FossilOrigin-Name: fb1b955dda5105025ef199880afa871e44331d65
2009-07-17 11:44:07 +00:00
drh
e64ca7ba11
Code simplifications and comment improvements in support of structural
...
coverage testing. (CVS 6899)
FossilOrigin-Name: 945251798144110787b197f9eb552a2dd4a25cb4
2009-07-16 18:21:17 +00:00