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

Side by Side Diff: third_party/sqlite/src/src/mem3.c

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/mem1.c ('k') | third_party/sqlite/src/src/mem5.c » ('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 ** 2007 October 14 2 ** 2007 October 14
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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 } 470 }
471 471
472 /* 472 /*
473 ** Return the size of an outstanding allocation, in bytes. The 473 ** Return the size of an outstanding allocation, in bytes. The
474 ** size returned omits the 8-byte header overhead. This only 474 ** size returned omits the 8-byte header overhead. This only
475 ** works for chunks that are currently checked out. 475 ** works for chunks that are currently checked out.
476 */ 476 */
477 static int memsys3Size(void *p){ 477 static int memsys3Size(void *p){
478 Mem3Block *pBlock; 478 Mem3Block *pBlock;
479 if( p==0 ) return 0; 479 assert( p!=0 );
480 pBlock = (Mem3Block*)p; 480 pBlock = (Mem3Block*)p;
481 assert( (pBlock[-1].u.hdr.size4x&1)!=0 ); 481 assert( (pBlock[-1].u.hdr.size4x&1)!=0 );
482 return (pBlock[-1].u.hdr.size4x&~3)*2 - 4; 482 return (pBlock[-1].u.hdr.size4x&~3)*2 - 4;
483 } 483 }
484 484
485 /* 485 /*
486 ** Round up a request size to the next valid allocation size. 486 ** Round up a request size to the next valid allocation size.
487 */ 487 */
488 static int memsys3Roundup(int n){ 488 static int memsys3Roundup(int n){
489 if( n<=12 ){ 489 if( n<=12 ){
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 memsys3Size, 678 memsys3Size,
679 memsys3Roundup, 679 memsys3Roundup,
680 memsys3Init, 680 memsys3Init,
681 memsys3Shutdown, 681 memsys3Shutdown,
682 0 682 0
683 }; 683 };
684 return &mempoolMethods; 684 return &mempoolMethods;
685 } 685 }
686 686
687 #endif /* SQLITE_ENABLE_MEMSYS3 */ 687 #endif /* SQLITE_ENABLE_MEMSYS3 */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/src/mem1.c ('k') | third_party/sqlite/src/src/mem5.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698