qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 1/2] QEMUSizedBuffer based QEMUFile


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v5 1/2] QEMUSizedBuffer based QEMUFile
Date: Wed, 08 Oct 2014 10:34:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

"Dr. David Alan Gilbert" <address@hidden> writes:

> * zhanghailiang (address@hidden) wrote:
>> On 2014/9/29 17:41, Dr. David Alan Gilbert (git) wrote:
>
>> >+static ssize_t qsb_grow(QEMUSizedBuffer *qsb, size_t new_size)
>> >+{
>> >+    size_t needed_chunks, i;
>> >+
>> >+    if (qsb->size < new_size) {
>> >+        struct iovec *new_iov;
>> >+        size_t size_diff = new_size - qsb->size;
>> >+        size_t chunk_size = (size_diff > QSB_MAX_CHUNK_SIZE)
>> >+                             ? QSB_MAX_CHUNK_SIZE : QSB_CHUNK_SIZE;
>> >+
>> >+        needed_chunks = DIV_ROUND_UP(size_diff, chunk_size);
>> >+
>> >+        new_iov = g_try_malloc_n(qsb->n_iov + needed_chunks,
>> >+                                 sizeof(struct iovec));
>> 
>> It seems that *g_try_malloc_n* was supported since glib2-2.24 version,
>> But it don't check this when do *configure* before compile...;)
>
> OK, that's a shame - it was a nice easy function to use :-)
> I'll fix it.

See also commit 02c4f26.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]