aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
Commit message (Collapse)AuthorAge
* Doc typo fix for SQLITE_MAX_ALLOCATION_SIZE in malloc.c. No code changes.stephan2022-12-03
| | | FossilOrigin-Name: ed1ed21221b048ac5a5275cdfc4d9b2a406acdc7d4b648c3b61bcc822d88d955
* Convert an ALWAYS() in sqlite3DbSpanDup() into an assert(), for a performancedrh2022-11-22
| | | | | increase and size reduction. FossilOrigin-Name: 21e80a29737c367babcc0cf2533eed61b5d0fcf3cc3c33ab88761899e394eaf3
* Provide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting thedrh2022-09-27
| | | | | maximum memory allocation size. FossilOrigin-Name: 584de6a996c78b8e41bdfcd05a8e2a3844664c6b4efedb5883c8b8af388462b5
* Performance enhancement for sqlite3DbFree().drh2022-08-22
| | | FossilOrigin-Name: c296a9d958ec360fc8d217363348b4918d665bccb3c4f27503a2dcef7db49052
* Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both thedrh2022-08-22
| | | | | | | db and ptr parameters are guaranteed to be non-NULL. Use this where appropriate to save more than 2 million CPU cycles on the standard performance test. FossilOrigin-Name: e5eaa80e81fdf86f2875a912b880272b8d099b82b08e945a7988c5dd0fe9d6b5
* When an OOM occurs and sets the Parse.nErr value, also set the Parse.nErrdrh2022-07-10
| | | | | | value for all outer Parse objects. dbsqlfuzz d33f60aaa67733aa700cd69dacf8e0e23a327a29 FossilOrigin-Name: 9a494d25944f4f640026e7a7ae2948e555d7af31487c55ed2ec2818a0789b887
* Modify utility function sqlite3SetString() so that it may be used safely on ↵dan2022-04-12
| | | | | Parse.zErrMsg. Fuzzer test case "crash-1604e5d76c92574e21e437049dab9b672e06b767.txt". FossilOrigin-Name: 09c5a4ec13b02efd6207e26dab7beaf184f0d8ccea0bd0dfe94fc803fe5636ce
* Make sure the sqlite3OomFault() routine sets an error in the Parse objectdrh2022-01-24
| | | | | if there is a Parse object active and linked to the database connection. FossilOrigin-Name: ad7aace761c6b21ba453eaf43c68d985be7cbd5a200fe0d2e27a0c7150f99874
* Add lots of new "const" on internal function parameters. There is opportunitydrh2021-09-24
| | | | | for many more - this is a work in progress. FossilOrigin-Name: a3c71a673ddd1c299bdae550fb955077b77088329a8ca2895dfb23538b524a8e
* Fix a problem with SQLITE_MAX_MEMORY in malloc.c.dan2021-05-21
| | | FossilOrigin-Name: c18dbe2f389f4ba7b219b7995d4f7009d1bc249ef8f93a30b262c6d2c008319d
* Improvements to the mechanism that attempts to report SQLITE_CORRUPT ifdrh2020-11-18
| | | | | pread() says that the underlying filesystem is corrupt. FossilOrigin-Name: b887c7504e7edeba758f3c1203c6cc56eef499fe05e7e6c6d82939bf7d78c57f
* On unix, for certain error codes of read()/pread() returndrh2020-11-18
| | | | | | SQLITE_IOERR_CORRUPTFS instead of SQLITE_IOERR_READ. And then convert this error into SQLITE_CORRUPT prior to returning back to the application. FossilOrigin-Name: 9538ea8447e7b07c05197d6ff2208d3e97b45798736c85b63e8f0c7a3a98c1f3
* Fix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()drh2020-10-20
| | | | | | in addition to sqlite3_malloc64(). Improvements to OOM processing and debugging aids in the fuzzcheck utility. FossilOrigin-Name: 602d7369166d406a26834aa47d71d565a17d377d32e41f308821a50b41f91896
* Small performance improvement and size reduction in sqlite3DbStrNDup().drh2020-07-16
| | | FossilOrigin-Name: 35cd87063d1933b87bc2176f957ecd758d7d167e9473fa615e33caec3be14783
* Use the sqlite3Realloc() interface internally, rather than the publicdrh2020-05-17
| | | | | | sqlite3_realloc64() equivalent, to avoid unnecessary calls to sqlite3_initialize(). FossilOrigin-Name: 1313557b512297e7b75ed748894379b2022aecf696d5a58318e46a668321c1ff
* Do not retry on a failed realloc() unless SQLITE_ENABLE_MEMORY_MANAGEMENTdrh2020-05-08
| | | | | is available, meaning that the retry has some possibility of success. FossilOrigin-Name: e9a8f910b5e2b84dd77364783f0610bca970cc88aa037c88636c72145b99f411
* Use AtomicStore() when setting the mem0.nearlyFull boolean to avoiddrh2020-04-28
| | | | | harmless TSAN warnings and to forestall doubts about threadsafety. FossilOrigin-Name: ce980af65a9b528f112baa22a95020a98ac5340155a0b53b09c46f99aad9b12b
* Use an AtomicLoad() macro in sqlite3HeapNearlyFull().drh2020-04-28
| | | FossilOrigin-Name: 7556bc632e271d8a1e4fd836ce91e28213768ac09c90857b91171e9cd1009884
* Use __atomic_load_n() and __atomic_store_n() for a few more things where ↵dan2020-03-30
| | | | | they are available. FossilOrigin-Name: a49f8ec552bede7da731e0571ccf49de1a30e7be3a5673150436c8b411ba6ffc
* Refactor names. Use "small" instead of "mini" to describe the smallerdrh2019-12-31
| | | | | of the two lookaside memory allocation sizes. FossilOrigin-Name: 88d244983854cdc1a369c5df09ae00f1098784db768ba4e17b963d187dcb1009
* Cleanup and performance enhancements for mini-lookaside.drh2019-12-13
| | | FossilOrigin-Name: 74805668430051032ae9b256c84e252755ee03075fc08293c948675ed40ec280
* Reduce the number of call sites to dbMallocRawFinish in the case where n > ↵numist2019-12-12
| | | | | lookaside.sz FossilOrigin-Name: e392e7f22861ce4b66e4bf84b59c8fd38568fc241a699e001f47fd82011f4d28
* Fix an issue where malloc could be used to fulfill a small allocation when a ↵numist2019-12-12
| | | | | large lookaside slot could have beeen used instead. FossilOrigin-Name: 611020e3378f4c81c277cccd84807ae51a816bbab6c3d887c91c5e5af3b5225f
* Change the size of a mini-lookaside allocation to a macro (MINI_SZ) ratherdrh2019-12-12
| | | | | than a magic number (128). FossilOrigin-Name: 5e1949bca998f3c8c23a8ebf01c7a2e7a2af1fdad43886271e1fe0f25411551d
* More efficient implementation of a lookaside allocator that supports mini ↵numist2019-12-12
| | | | | (in this case, harcoded to 128B) slots. FossilOrigin-Name: b02fdc09c838f355d9efce57f817d6a86153153b4a1f2b763914f4aaa34cb76e
* Fix a bug in the hard_heap_limit pragma so that it returns the new value ofdrh2019-11-14
| | | | | | 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. FossilOrigin-Name: 33fd0c3abcad5555a150990a22d9c1bab99e79be01143fccb9fafc9b52cf92c8
* Merge recent enhancements from trunk.drh2019-11-14
|\ | | | | FossilOrigin-Name: b8a631fd30d0732505679230684b3362c965438197a2b11518f01a77599c9202
| * Performance optimization to the lookaside-memory disabling mechanism.drh2019-10-05
| | | | | | FossilOrigin-Name: 17ce1c49cb0ed6fdd8c7c33431bc2afa217f1092c99b8dd608890a8e7aec7fb1
* | Add the sqlite3_hard_heap_limit64() interface and the correspondingdrh2019-04-25
|/ | | | | "PRAGMA hard_heap_limit=N" command. FossilOrigin-Name: b0ccef61a7f92d20228becbf4f997bf0f4e46dad2deaf0896dc63b976ad1dd11
* Give the sqlite3 object a pointer to the current Parse so that if an OOMdrh2019-02-08
| | | | | | 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. FossilOrigin-Name: 5c6638040b3017c6be016441422d965a3ca00dd6ae1f78cadc0b54562978f64e
* Tag an unreachable branch using ALWAYS().drh2018-01-10
| | | FossilOrigin-Name: c42c734f11c58724f5d8b32cb1c92e274be350028868d6ed045b2cfd274c64e7
* Add and use the internal sqlite3DbSpanDup() interface.drh2017-12-27
| | | FossilOrigin-Name: a8e1545cb7aacb6a26a8c92a3ad4a3d584d150c3a00d2828c8adbb1ee19fcb6d
* Faster memory allocation from lookaside by not trying to keep track of thedrh2017-08-29
| | | | | | number of outstanding allocations, and rather computing that value only when requested. FossilOrigin-Name: a06263f1efd2d45eac88b8d59e8fe8e458670fa3808c795feaa7f247fc36cbe9
* Remove the rarely-used scratch memory allocator. This makes the code smaller,drh2017-08-28
| | | | | | | 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. FossilOrigin-Name: 54b000246cfb5c7b8adb61a17357ef5a49adddde9e48e8937834d5ba0beb8a6b
* Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases wheredrh2017-04-05
| | | | | we know that the argument to be freed is never NULL. FossilOrigin-Name: ad90e8bb5e47945607c8fb47b6ade8cfc52a9b684805cc40132629be0ecc14cc
* Fix an error in the SQLITE_MAX_MEMORY implementation resulting from a baddrh2017-03-10
| | | | | | merge. Update the OSSFuzz interface so that it times out after running the byte-code engine for 10 seconds. FossilOrigin-Name: f8560c60d10c0365b33342ab05b5a953987b0471
* Add the -DSQLITE_MAX_MEMORY=N compile-time option. The default is no limit.drh2017-03-10
|\ | | | | FossilOrigin-Name: eabd4ef498a0f0d97d65e321c4d06ab90523ed61
| * Add the SQLITE_MAX_MEMORY compile-time option that provides a hard upper bounddrh2017-03-10
|/ | | | | on the amount of memory that SQLite will use, per process. FossilOrigin-Name: 77dfe2abdae88dea81217f352d87e5ba2c822715
* Change all legacy instances of "#if SQLITE_DEBUG" to "#ifdef SQLITE_DEBUG" fordrh2017-02-13
| | | | | consistency. FossilOrigin-Name: 670f10b24230863688270d12ac519609ade2302b
* Typo fixes in comment. No changes to code.mistachkin2017-02-08
| | | FossilOrigin-Name: c09dd5c0befaf5028abfead8114bd74a30ffe5d4
* Always invoke the xRoundup() method of the memory allocator before callingdrh2017-02-08
| | | | | xMalloc(). FossilOrigin-Name: 77b470b0df73dc5ae5ad2f0170ef7c50558c7c88
* Fix the build for SQLITE_ENABLE_MEMORY_MANAGEMENT.drh2017-01-13
| | | FossilOrigin-Name: 8c85b8fdd7f0ba65fba83361d361a567b797a184
* Avoid unnecessary calls to the xRoundup() method of the memory allocator whendrh2017-01-10
| | | | | the soft heap limit is not set. FossilOrigin-Name: 4209b89eab01814228a178963238e0dffffad2a4
* Avoid a potential (harmless) signed integer overflow in memory usagedrh2016-12-27
| | | | | | accounting when calling sqlite3_realloc() to reduce the size of an allocation. FossilOrigin-Name: 2d71cbdf6bc24f0269027c70b39ea7f342436bdb
* Small size reduction and performance increase in the string duplicator.drh2016-10-17
| | | FossilOrigin-Name: cda998f080cb00779d8c0d1c83d8fe2b74462cd4
* Enhance ability to debug out-of-memory errors.mistachkin2016-02-13
| | | FossilOrigin-Name: 6a9c4a3ebfb7cc0738ef6634440ccab44a21ff28
* Make sure variable declarations occur at the beginning of blocks, evendrh2016-02-06
| | | | | with SQLITE_DEBUG enabled. FossilOrigin-Name: 2f7778e64d93ef237e23ceac01ea9808df5cf2a1
* Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majoritydrh2016-02-05
| | | | | cases where db is guaranteed to be not NULL. FossilOrigin-Name: 0a802e96ab06e2643834b83671fa8353da1a348d
* Further performance improvements that fall out of the mallocFailed changes.drh2016-02-05
| | | FossilOrigin-Name: d94416ddca8f7ed727dd335d38155ea5945a86b7
* Improvements to the way that OOM errors are processed.drh2016-02-05
| | | FossilOrigin-Name: c3ef03478a5788c855b3aef385d43ae7f494f440