On 8/12/19 11:08 AM, Richard W.M. Jones wrote:
Instead of using the valid_flag == FREE mechanism, use a free callback to free each closure root. --- generator/generator | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Looks like a straight swap; at this point in the series, valid_flag & FREE is called exactly as many times as a free callback; and moving to a free callback would mean a later patch could get rid of valid_flag if we wanted (although that's a C API change). Still, if we're able to reliably call the C nbd_aio_pread_callback even from the OCaml nbd.aio_pread, then the valid_flag = FREE mechanism results in fewer function calls than having to register a free callback for each pointer to be cleaned up. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org