Flush cache after modifying code.
Set INTERNAL_REFERENCE in kApplyMask.
Relocate INTERNAL_REFERENCE when growing buffer.