SQLite

Check-in [7fbb083c5c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the unix VFS, fix the heap shm allocator (used for unix-excl) so that it works even on systems where the page size is larger than 32KB.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7fbb083c5cf0948af3624b7538ffa086f77de27a3e84a7039ae7d6574f1a3a54
User & Date: drh 2018-10-11 02:39:11.173
Context
2018-10-11
10:37
In the CLI, fix a file descriptor leak following OOM and a missing va_end() call. (check-in: ec36d15a9e user: drh tags: trunk)
02:39
In the unix VFS, fix the heap shm allocator (used for unix-excl) so that it works even on systems where the page size is larger than 32KB. (check-in: 7fbb083c5c user: drh tags: trunk)
2018-10-10
18:56
In the CLI, allow the SQLITE_HISTORY environment variable, if it exists, to specify an alternative file in which to store the shell edit history. (check-in: 696e82f7c8 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
            MAP_SHARED, pShmNode->hShm, szRegion*(i64)pShmNode->nRegion
        );
        if( pMem==MAP_FAILED ){
          rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
          goto shmpage_out;
        }
      }else{
        pMem = sqlite3_malloc64(szRegion);
        if( pMem==0 ){
          rc = SQLITE_NOMEM_BKPT;
          goto shmpage_out;
        }
        memset(pMem, 0, szRegion);
      }

      for(i=0; i<nShmPerMap; i++){
        pShmNode->apRegion[pShmNode->nRegion+i] = &((char*)pMem)[szRegion*i];
      }
      pShmNode->nRegion += nShmPerMap;
    }







|




|







4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
            MAP_SHARED, pShmNode->hShm, szRegion*(i64)pShmNode->nRegion
        );
        if( pMem==MAP_FAILED ){
          rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
          goto shmpage_out;
        }
      }else{
        pMem = sqlite3_malloc64(nMap);
        if( pMem==0 ){
          rc = SQLITE_NOMEM_BKPT;
          goto shmpage_out;
        }
        memset(pMem, 0, nMap);
      }

      for(i=0; i<nShmPerMap; i++){
        pShmNode->apRegion[pShmNode->nRegion+i] = &((char*)pMem)[szRegion*i];
      }
      pShmNode->nRegion += nShmPerMap;
    }
Changes to test/wal64k.test.
42
43
44
45
46
47
48












49
50
51
  }
  execsql COMMIT
  file size test.db-shm
} {131072}

integrity_check 1.3













db close
test_syscall pagesize -1
finish_test







>
>
>
>
>
>
>
>
>
>
>
>



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  }
  execsql COMMIT
  file size test.db-shm
} {131072}

integrity_check 1.3

db close
forcedelete test.db
sqlite3 db test.db -vfs unix-excl
do_execsql_test 2.1 {
  PRAGMA page_size=512;
  PRAGMA journal_mode=WAL;
  CREATE TABLE t1(a,b);
  WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<8200)
  INSERT INTO t1(a,b) SELECT x, zeroblob(300) FROM c;
  PRAGMA integrity_check;
} {wal ok}

db close
test_syscall pagesize -1
finish_test