Esempio n. 1
0
File: db.go Progetto: tradia/gotable
func (db *DB) Close() {
	if db.db != nil {
		C.rocksdb_close(db.db)
		db.db = nil

		if db.opt != nil {
			C.rocksdb_options_destroy(db.opt)
		}
		if db.rOpt != nil {
			C.rocksdb_readoptions_destroy(db.rOpt)
		}
		if db.wOpt != nil {
			C.rocksdb_writeoptions_destroy(db.wOpt)
		}
		if db.cache != nil {
			C.rocksdb_cache_destroy(db.cache)
		}
		if db.fp != nil {
			C.rocksdb_filterpolicy_destroy(db.fp)
		}
	}
}
Esempio n. 2
0
// Close deallocates the underlying memory of the Cache object.
func (c *Cache) Close() {
	C.rocksdb_cache_destroy(c.Cache)
}
Esempio n. 3
0
// Destroy deallocates the Cache object.
func (self *Cache) Destroy() {
	C.rocksdb_cache_destroy(self.c)
	self.c = nil
}
Esempio n. 4
0
// Destroy deallocates the Cache object.
func (c *Cache) Destroy() {
	C.rocksdb_cache_destroy(c.c)
	c.c = nil
}