SQLite Forum

pending lock macro
Login
>  i'm not sure about is the 0x40000000 offset from the beginning of the database file ? if it is ,when the database file size less than 0x40000000(aka 1GB),where is region for the pending_byte in database file ?


That's explained in the source code:

<https://sqlite.org/src/info?name=48388821692e87da&ln=91-145>

A partial snippet of those docs:

```
** Locking in windows is manditory.  For this reason, we cannot store
** actual data in the bytes used for locking.  The pager never allocates
** the pages involved in locking therefore.  SHARED_SIZE is selected so
** that all locks will fit on a single page even at the minimum page size.
** PENDING_BYTE defines the beginning of the locks.  By default PENDING_BYTE
** is set high so that we don't have to allocate an unused page except
** for very large databases.  But one should test the page skipping logic 
** by setting PENDING_BYTE low and running the entire regression suite.
```