示例#1
0
文件: db.go 项目: 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)
		}
	}
}
示例#2
0
文件: cache.go 项目: ma6174/rocksdb
// Close deallocates the underlying memory of the Cache object.
func (c *Cache) Close() {
	C.rocksdb_cache_destroy(c.Cache)
}
示例#3
0
文件: cache.go 项目: butine/research
// Destroy deallocates the Cache object.
func (self *Cache) Destroy() {
	C.rocksdb_cache_destroy(self.c)
	self.c = nil
}
示例#4
0
文件: cache.go 项目: Colearo/fabric
// Destroy deallocates the Cache object.
func (c *Cache) Destroy() {
	C.rocksdb_cache_destroy(c.c)
	c.c = nil
}