Thanks for the review and the fixes. I found a couple more things. First, it's not portable to cast wint_t * to wchar_t *, since the pointed-to types might be different sizes or representations. Second, we can put the cache directly in the struct dfa, saving the overhead of doing a separate malloc. The attached further patch should address these problems. I pushed this, along with the earlier two patches in this sequence, and am marking this as done.