mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-15 15:28:04 +00:00
The upstream btree code has a test file, this is an import of that test file, adjusted/adapted to make it work with our de-genericized uint64/*Container implementation, so we have some tests and benchmarks available for the btree implementation itself.
27 lines
341 B
Go
27 lines
341 B
Go
// +build btreeInstrumentation
|
|
|
|
package roaring
|
|
|
|
type dTree struct {
|
|
t *tree
|
|
}
|
|
|
|
type treeInst struct {
|
|
deCopied int64
|
|
}
|
|
|
|
func (t *tree) didCopy(n int) {
|
|
t.deCopied += int64(n)
|
|
}
|
|
|
|
func (d *d) didCopy(n int) {
|
|
d.t.deCopied += int64(n)
|
|
}
|
|
|
|
func (t *tree) countCopies() int64 {
|
|
return t.deCopied
|
|
}
|
|
|
|
func (d *d) setTree(t *tree) {
|
|
d.t = t
|
|
}
|