Beispiel #1
0
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)
		}
	}
}
Beispiel #2
0
// Close deallocates the underlying memory of the Cache object.
func (c *Cache) Close() {
	C.rocksdb_cache_destroy(c.Cache)
}
Beispiel #3
0
// Destroy deallocates the Cache object.
func (self *Cache) Destroy() {
	C.rocksdb_cache_destroy(self.c)
	self.c = nil
}
Beispiel #4
0
// Destroy deallocates the Cache object.
func (c *Cache) Destroy() {
	C.rocksdb_cache_destroy(c.c)
	c.c = nil
}