Documentation ¶
Overview ¶
Package db implements a simple key-value database. The database is cached in memory and mirrored on disk. It is used to store corpus in syz-manager and syz-hub. The database strives to minimize number of disk accesses as they can be slow in virtualized environments (GCE).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct { Version uint64 // arbitrary user version (0 for new database) Records map[string]Record // in-memory cache, must not be modified directly // contains filtered or unexported fields }
func Open ¶
Open opens the specified database file. If the database is corrupted and reading failed, then it returns an non-nil db with whatever records were recovered and a non-nil error at the same time.
func (*DB) BumpVersion ¶
func (*DB) DiscardData ¶
func (db *DB) DiscardData()
DiscardData discards all record's values from memory. This allows to save memory if values are not needed anymore, but in exchange every compaction will need to re-read all data from disk.