It is possible to implement a mixed-granularity address translation scheme that consists of both coarse-grained pointer swizzling and fine-grained address translation. The interaction of swizzling with data structures such as B-trees can be handled through the use of the smart pointer abstraction. The details of a fine-grained address translation scheme are hidden, making the approach partially reflective.
We have implemented mixed-granularity address translation in Texas by combining a fine-grained approach using smart pointers that are translated at every use, along with the standard coarse-grained approach. This allows better programmer control over the choice of data structures for which fine-grained address translation is used, while maintaining the overall performance of pointer swizzling at page fault time.