patch that adds support for virtual function free encode/decode

not clear that it is worthwhile though