search for: bufferiszero

Displaying 2 results from an estimated 2 matches for "bufferiszero".

2017 Apr 19
1
Re: [PATCH] daemon: Move the useful 'is_zero' function into common code.
...; for (i = 0; i < limit; ++i) > if (buffer[i]) > return 0; > if (size != limit) > return !memcmp(buffer, buffer + 16, size - 16); > return 1; If performance is critical, QEMU has a permissively licensed impl that uses sse/avx instructions to super-optimize it on x86 (util/bufferiszero.c). It is a large amount of code though, so only worth it if this is a notable bottleneck for libguestfs. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://en...
2017 Apr 19
2
[PATCH] daemon: Move the useful 'is_zero' function into common code.
This is largely a simple refactoring, but it combines another definition of this function from virt-builder which had a slightly different prototype. --- builder/pxzcat-c.c | 20 +------------------- daemon/daemon.h | 18 ------------------ lib/guestfs-internal-all.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 37 deletions(-) diff --git a/builder/pxzcat-c.c