Browse Source
While implementing a custom subclass of DfsStreamKey it became obvious the required derive(String) was making it impossible to construct an efficient key in all cases. Instead, use a special wrapper type ForReverseIndex around the INDEX's own DfsStreamKey to denote the reverse index stream in the DfsBlockCache. This adds a smaller layer of boxing, but eliminates weird issues for DFS implementors using specialized DfsStreamKey implementations for space efficiency reasons. Now that DfsStreamKey is reasonably light-weight, avoid allocating the index and reverse index keys until necessary. DfsPackFile mostly holds the DfsBlockCache.Ref handle to the object, and only needs the DfsStreamKey when its looking up the handle. Change-Id: Icea78e8f7f1514087b94ef5f525d9573ea2913f2stable-4.9
Shawn Pearce
7 years ago
2 changed files with 23 additions and 30 deletions
Loading…
Reference in new issue