I wonder if work has been done on the subject since 2011. I tried to insert it in version 1.7.6 of the library as a first step to add rpc support introduced by Gilles Gaillard in AVRO-777. I have only a shallow understanding of avro and the improvements by Gilles.
Most of the code contained in frame_memory_patch could be reported in version 1.7.6. However, there are some parts that are more delicate to insert. When the read type of the value is in AVRO_BYTES and message framing is used (in value-readc.c), the read_bytes method does not allocate memory but rather returns a pointer to the data. The pointed data should not be free. So in this case, the free function specified in avro_wrapped_alloc_new should free the avro_wrapped_buffer structure but not the data inside.
1. Is my understanding correct?
2. Does this mechanism apply for other value types? I think does not apply to simple types such as AVRO_FLOAT, AVRO_DOUBLE, but I wonder if it applies to more complex types such as AVRO_STRING, AVRO_ARRAY, AVRO_MAP, where memory copy might be avoided.