]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a table of shared-memory lock offsets in a comment in the os_unix.c code.
authordrh <>
Wed, 19 May 2021 16:55:28 +0000 (16:55 +0000)
committerdrh <>
Wed, 19 May 2021 16:55:28 +0000 (16:55 +0000)
Include some assert()s to help verify the numbers.

FossilOrigin-Name: b480aacb3430a789d98ffd81a1886bbbc3cda5b0e736ec9a3e2b463db2a3b3ad

manifest
manifest.uuid
src/os_unix.c

index 0aa7c7bbf49c21551643c558999eab6b5388195a..251c2e344fe77b5599b3711e9ca02a12e8671763 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Allow\saggregate\ssub-selects\swithin\sORDER\sBY\sand\sPARTITION\sBY\sclauses\sof\swindow\sframe\sdefinitions.
-D 2021-05-19T14:49:51.085
+C Add\sa\stable\sof\sshared-memory\slock\soffsets\sin\sa\scomment\sin\sthe\sos_unix.c\scode.\nInclude\ssome\sassert()s\sto\shelp\sverify\sthe\snumbers.
+D 2021-05-19T16:55:28.355
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -527,7 +527,7 @@ F src/os.c 6e94cd64b134c9317e52ad534117578e3df66ec180d70dbf4b1d7eb1db8e5a5d
 F src/os.h 48388821692e87da174ea198bf96b1b2d9d83be5dfc908f673ee21fafbe0d432
 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
 F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
-F src/os_unix.c b5b7475bd1a8f1b83b6173a81f4fe50f9e077ccbacb62ce2fe7a5cb89916bce1
+F src/os_unix.c e96732e6faf20a286a107a060b381ac1a70fd78939fd344091e5b8a33f008726
 F src/os_win.c 77d39873836f1831a9b0b91894fec45ab0e9ca8e067dc8c549e1d1eca1566fe9
 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
 F src/pager.c 95c255256b13827caf038c8f963d334784073f38ab6ef9d70371d9d04f3c43e0
@@ -1913,7 +1913,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 699c33990a9438f28673ecf34f1e521d1af0b01c6ee30a608c0c91d2d593590e
-R 0588b9cafca27fd37e2a788a361f330d
-U dan
-Z 63f7d84596bbfc34c19eb092e10320fc
+P 3daab94977af5e8a95690acc555540311403d890a3261a9757c633fcaaf428a9
+R 9d32076e7e00d2e7f5400eef1e259834
+U drh
+Z b4aac95cbd89fc77e944acb5b9058e59
index cead1d48d872077c11f58df163499e79cdc05685..1dab90556acdeaba589cea6bc871092da592d86e 100644 (file)
@@ -1 +1 @@
-3daab94977af5e8a95690acc555540311403d890a3261a9757c633fcaaf428a9
\ No newline at end of file
+b480aacb3430a789d98ffd81a1886bbbc3cda5b0e736ec9a3e2b463db2a3b3ad
\ No newline at end of file
index adc89f5a7c5d8b5922ff3295dffcb806f124fc5e..76b4497a698d0180f2e2b39a004bd70b5ed90e3a 100644 (file)
@@ -8067,6 +8067,21 @@ int sqlite3_os_init(void){
     sqlite3_vfs_register(&aVfs[i], i==0);
   }
   unixBigLock = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1);
+
+  /* Validate lock assumptions */
+  assert( SQLITE_SHM_NLOCK==8 );  /* Number of available locks */
+  assert( UNIX_SHM_BASE==120  );  /* Start of locking area */
+  /* Locks:
+  /*    WRITE       UNIX_SHM_BASE      120  */
+  /*    CKPT        UNIX_SHM_BASE+1    121  */
+  /*    RECOVER     UNIX_SHM_BASE+2    122  */
+  /*    READ-0      UNIX_SHM_BASE+3    123  */
+  /*    READ-1      UNIX_SHM_BASE+4    124  */
+  /*    READ-2      UNIX_SHM_BASE+5    125  */
+  /*    READ-3      UNIX_SHM_BASE+6    126  */
+  /*    READ-4      UNIX_SHM_BASE+7    127  */
+  /*    DMS         UNIX_SHM_BASE+8    128  */
+  assert( UNIX_SHM_DMS==128   );  /* Byte offset of the deadman-switch */
   return SQLITE_OK; 
 }