Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Do not use the Linux mremap() call. Use the same strategy for xMremap() as on OSX instead. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | experimental-mmap |
Files: | files | file ages | folders |
SHA1: |
5ed8ad780c991d2ca44003ee84350fb5 |
User & Date: | dan 2013-03-21 14:47:47.427 |
Context
2013-03-21
| ||
15:57 | Fix a problem when opening a write-transaction while there exist read-only b-tree cursors in mmap mode. (check-in: 32e0bbb736 user: dan tags: experimental-mmap) | |
14:47 | Do not use the Linux mremap() call. Use the same strategy for xMremap() as on OSX instead. (check-in: 5ed8ad780c user: dan tags: experimental-mmap) | |
2013-03-20
| ||
18:25 | Optimize the xMremap method in os_unix.c some. (check-in: 9529ed88a7 user: dan tags: experimental-mmap) | |
Changes
Changes to src/os_unix.c.
︙ | ︙ | |||
4474 4475 4476 4477 4478 4479 4480 | /* According to some sources, the effect of changing the size of the ** underlying file on mapped regions that correspond to the added or ** removed pages is undefined. However, there is reason to believe that ** on modern platforms like Linux or OSX, things just work. For example, ** it is possible to create a mapping larger than the file on disk and ** extend the file on disk later on. ** | | | | | | < < < < | < < < < < < < < < < < < < < | 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 | /* According to some sources, the effect of changing the size of the ** underlying file on mapped regions that correspond to the added or ** removed pages is undefined. However, there is reason to believe that ** on modern platforms like Linux or OSX, things just work. For example, ** it is possible to create a mapping larger than the file on disk and ** extend the file on disk later on. ** ** Exploit this on Linux and OSX to reduce the number of munmap()/mmap() ** calls required if the file size is changing. In this case all mappings ** are rounded up to the nearest 4MB. And if a new mapping is requested ** that has the same rounded size as an old mapping, the old mapping can ** be reused as is. */ #if defined(__APPLE__) || defined(__linux__) nNewRnd = ROUNDUP(nNew, 4096*1024); nOldRnd = ROUNDUP(nOld, 4096*1024); #else nNewRnd = ROUNDUP(nNew, 4096*1); nOldRnd = ROUNDUP(nOld, 4096*1); #endif /* On OSX or Linux, reuse the old mapping if it is the right size. */ #if defined(__APPLE__) || defined(__linux__) if( nNewRnd==nOldRnd ){ return SQLITE_OK; } #endif /* If we get this far, unmap any old mapping. */ if( nOldRnd!=0 ){ void *pOld = *ppMap; |
︙ | ︙ |