Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: third_party/sqlite/src/src/btreeInt.h

Issue 2732553002: [sql] SQLite patch to implement "smart" auto-vacuum. (Closed)
Patch Set: sigh, keep clang happy on windows Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/src/btree.c ('k') | third_party/sqlite/src/src/pragma.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2004 April 6 2 ** 2004 April 6
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 ** This feature is included to help prevent writer-starvation. 405 ** This feature is included to help prevent writer-starvation.
406 */ 406 */
407 struct BtShared { 407 struct BtShared {
408 Pager *pPager; /* The page cache */ 408 Pager *pPager; /* The page cache */
409 sqlite3 *db; /* Database connection currently using this Btree */ 409 sqlite3 *db; /* Database connection currently using this Btree */
410 BtCursor *pCursor; /* A list of all open cursors */ 410 BtCursor *pCursor; /* A list of all open cursors */
411 MemPage *pPage1; /* First page of the database */ 411 MemPage *pPage1; /* First page of the database */
412 u8 openFlags; /* Flags to sqlite3BtreeOpen() */ 412 u8 openFlags; /* Flags to sqlite3BtreeOpen() */
413 #ifndef SQLITE_OMIT_AUTOVACUUM 413 #ifndef SQLITE_OMIT_AUTOVACUUM
414 u8 autoVacuum; /* True if auto-vacuum is enabled */ 414 u8 autoVacuum; /* True if auto-vacuum is enabled */
415 u8 autoVacuumSlack; /* Optional pages of slack for auto-vacuum */
415 u8 incrVacuum; /* True if incr-vacuum is enabled */ 416 u8 incrVacuum; /* True if incr-vacuum is enabled */
416 u8 bDoTruncate; /* True to truncate db on commit */ 417 u8 bDoTruncate; /* True to truncate db on commit */
417 #endif 418 #endif
418 u8 inTransaction; /* Transaction state */ 419 u8 inTransaction; /* Transaction state */
419 u8 max1bytePayload; /* Maximum first byte of cell for a 1-byte payload */ 420 u8 max1bytePayload; /* Maximum first byte of cell for a 1-byte payload */
420 #ifdef SQLITE_HAS_CODEC 421 #ifdef SQLITE_HAS_CODEC
421 u8 optimalReserve; /* Desired amount of reserved space per page */ 422 u8 optimalReserve; /* Desired amount of reserved space per page */
422 #endif 423 #endif
423 u16 btsFlags; /* Boolean parameters. See BTS_* macros below */ 424 u16 btsFlags; /* Boolean parameters. See BTS_* macros below */
424 u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */ 425 u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 */ 693 */
693 #if SQLITE_BYTEORDER==4321 694 #if SQLITE_BYTEORDER==4321
694 # define get2byteAligned(x) (*(u16*)(x)) 695 # define get2byteAligned(x) (*(u16*)(x))
695 #elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4008000 696 #elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4008000
696 # define get2byteAligned(x) __builtin_bswap16(*(u16*)(x)) 697 # define get2byteAligned(x) __builtin_bswap16(*(u16*)(x))
697 #elif SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300 698 #elif SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
698 # define get2byteAligned(x) _byteswap_ushort(*(u16*)(x)) 699 # define get2byteAligned(x) _byteswap_ushort(*(u16*)(x))
699 #else 700 #else
700 # define get2byteAligned(x) ((x)[0]<<8 | (x)[1]) 701 # define get2byteAligned(x) ((x)[0]<<8 | (x)[1])
701 #endif 702 #endif
OLDNEW
« no previous file with comments | « third_party/sqlite/src/src/btree.c ('k') | third_party/sqlite/src/src/pragma.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698