[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] some questions about g_malloc in qemu
From: |
Max Filippov |
Subject: |
Re: [Qemu-devel] some questions about g_malloc in qemu |
Date: |
Thu, 15 Dec 2011 13:37:13 +0300 |
>> >> I found this in HACKING:
>> >>
>> >> Please note that NULL check for the g_malloc result is redundant and
>> >> that g_malloc() call with zero size is not allowed.
>> >
>> > So we have:
>> >
>> > 1. You should not request 0 bytes from g_malloc().
>>
>> I think this was related to qemu_malloc() and Anthony's sed run made it
>> refer to g_malloc(), even though it works just fine with 0 bytes. We
>> should probably remove this sentence.
>
> If you remove it then you can't interpret it the way I did. It's not
> longer possible to say that g_malloc() never returns NULL. You always
> have to qualify that with "unless you ask for 0 bytes". :)
I have a number of ELFs that result in ELF loader making zero-size malloc.
Previously I had to enable CONFIG_ZERO_MALLOC, now it just works.
--
Thanks.
-- Max
- [Qemu-devel] some questions about g_malloc in qemu, Zhi Hui Li, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, 陳韋任, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, Andreas Färber, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, 陳韋任, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, Stefan Hajnoczi, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, Kevin Wolf, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, Stefan Hajnoczi, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu,
Max Filippov <=
- Re: [Qemu-devel] some questions about g_malloc in qemu, Kevin Wolf, 2011/12/15
- Re: [Qemu-devel] some questions about g_malloc in qemu, Peter Maydell, 2011/12/15