[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] util: introduce bitmap_try_new
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] util: introduce bitmap_try_new |
Date: |
Fri, 05 Sep 2014 16:17:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 09/05/2014 02:00 PM, Peter Lieven wrote:
>>> +
>> What you have works, but I personally would have reimplemented
>> bitmap_new as the first caller of bitmap_try_new in this patch, where
>> bitmap_new handles a NULL bitmap_try_new return by abort()ing, so that
>> it has the same behavior. By routing the one function to use the other,
>> we are future-proofing: if initialization of a bitmap ever needs
>> modification, we only update bitmap_try_new, rather than copying the
>> updates to both functions.
>>
>
> Good point. What would be the right exit if we receive a NULL from
> bitmap_try_new? abort() ?
I think that g_malloc() calls abort(), so yes, that sounds right.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature