[Top][All Lists]

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

Re: [Qemu-trivial] [PATCH] object_new_with_type: remove redundant code

From: Cao jin
Subject: Re: [Qemu-trivial] [PATCH] object_new_with_type: remove redundant code
Date: Fri, 6 Nov 2015 19:28:20 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Hi Michael,

Thanks very much for your reply, there is a tiny mistake here, I sent the patch with email format typo "address@hidden" and got "undeliverable" feeback. so I sent it again...I thought you can`t receive the 1st one, but obviously I make a wrong guess...I Already replied the 2nd one stating that I realized I am wrong about this patch: type_initialize(type) is used to assign a value to type->instance_size when it is called 1st time, so it could malloc in the following.

Your opinion make sense to me, thanks for sharing it with me. As a personal habit, I prefer to figure out the arch of the project when I learn it, and you know, sometimes it is hard to figure out why author wrote that way, especially lacking of doc and comment, and having no one around to discuss with. So, Thanks very much for discussing with me and your time, I appreciate it.

On 11/06/2015 04:11 PM, Michael Tokarev wrote:
05.11.2015 08:16, Cao jin wrote:
g_assert & type_initialize are called in object_initialize_with_type

object_new_with_type() is a separate QOM API function.  If we're
to rely on other functions calling it to check for parameters,
we should probably remove it from public API and make it static.

And yes, I'm aware of the fact that currently object_new_with_type()
is only called from object_initialize_with_type().  This is not a
good reason to drop the check/init, since object_new_with_type()
remains a published API and might be used in other places in the



Yours Sincerely,

Cao Jin

reply via email to

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