]> Git Repo - qemu.git/commit - migration/qemu-file.h
Add qemu_get_buffer_in_place to avoid copies some of the time
authorDr. David Alan Gilbert <[email protected]>
Thu, 5 Nov 2015 18:10:35 +0000 (18:10 +0000)
committerJuan Quintela <[email protected]>
Tue, 10 Nov 2015 13:51:48 +0000 (14:51 +0100)
commit9504fb510c87c3dd6fe2e9a25e84c1426672f226
treef6fa039d3c9411ccaadf729104e9e79a2d84756d
parent42e2aa56372291d35345fcec85d5da2004c8b57c
Add qemu_get_buffer_in_place to avoid copies some of the time

qemu_get_buffer always copies the data it reads to a users buffer,
however in many cases the file buffer inside qemu_file could be given
back to the caller, avoiding the copy.  This isn't always possible
depending on the size and alignment of the data.

Thus 'qemu_get_buffer_in_place' either copies the data to a supplied
buffer or updates a pointer to the internal buffer if convenient.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
include/migration/qemu-file.h
migration/qemu-file.c
This page took 0.025733 seconds and 4 git commands to generate.