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
This commit is contained in:
drh
2014-11-04 14:22:27 +00:00
parent 5279d3433c
commit cbd55b0362
6 changed files with 24 additions and 30 deletions
+2 -6
View File
@@ -1541,13 +1541,9 @@ struct sqlite3_mem_methods {
** and the maximum number of scratch allocations (N).)^
** The first argument must be a pointer to an 8-byte aligned buffer
** of at least sz*N bytes of memory.
** ^SQLite will not use more than two scratch buffers per thread and not
** more than one scratch buffer per thread when not performing
** a [checkpoint] in [WAL mode].
** ^SQLite will not use more than one scratch buffers per thread.
** ^SQLite will never request a scratch buffer that is more than 6
** times the database page size, except when performing a [checkpoint]
** in [WAL mode] when the scratch buffer request size is a small fraction
** of the size of the WAL file.
** times the database page size.
** ^If SQLite needs needs additional
** scratch memory beyond what is provided by this configuration option, then
** [sqlite3_malloc()] will be used to obtain the memory needed.<p>