(mmapSize, growSize int)
| 1261 | } |
| 1262 | |
| 1263 | func (db *DB) growSize(mmapSize, growSize int) int { |
| 1264 | // If the data is smaller than the alloc size then only allocate what's needed. |
| 1265 | // Once it goes over the allocation size then allocate in chunks. |
| 1266 | if mmapSize <= db.AllocSize { |
| 1267 | return mmapSize |
| 1268 | } else { |
| 1269 | return growSize + db.AllocSize |
| 1270 | } |
| 1271 | } |
| 1272 | |
| 1273 | func (db *DB) IsReadOnly() bool { |
| 1274 | return db.readOnly |