qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Pooja Dhannawat <dhannawatpooja1@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v4] socket: Allocating Large sized arrays to heap
Date: Fri, 18 Mar 2016 09:35:19 +0000	[thread overview]
Message-ID: <20160318093519.GA16661@stefanha-x1.localdomain> (raw)
In-Reply-To: <56EB34A7.9030601@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

On Thu, Mar 17, 2016 at 11:50:15PM +0100, Paolo Bonzini wrote:
> 
> 
> On 17/03/2016 16:31, Pooja Dhannawat wrote:
> > 
> > 
> > On Thu, Mar 17, 2016 at 8:20 PM, Stefan Hajnoczi <stefanha@gmail.com
> > <mailto:stefanha@gmail.com>> wrote:
> > 
> >     On Tue, Mar 15, 2016 at 09:29:58PM +0530, Pooja Dhannawat wrote:
> >     > @@ -170,8 +170,8 @@ static void net_socket_send(void *opaque)
> >     >          s->index = 0;
> >     >          s->packet_len = 0;
> >     >          s->nc.link_down = true;
> >     > -        memset(s->buf, 0, sizeof(s->buf));
> > 
> >     This change is unrelated to allocating buf1 on the heap.  What is the
> >     purpose of this line?
> > 
> > 
> > I moved buf from stack to Heap, used g_new(), but I got your point if we
> > need to initialize it with 0 then I have to keep that one.
> > 
> > Other wise doing so it gets whatever garbage it has already.  
> 
> This is s->buf, not buf.

Exactly, they are different variables.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-03-18  9:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 15:59 [Qemu-devel] [PATCH v4] socket: Allocating Large sized arrays to heap Pooja Dhannawat
2016-03-17 14:50 ` Stefan Hajnoczi
2016-03-17 15:31   ` Pooja Dhannawat
2016-03-17 22:50     ` Paolo Bonzini
2016-03-18  9:35       ` Stefan Hajnoczi [this message]
2016-03-18 11:12         ` Pooja Dhannawat
2016-03-18 11:24       ` Pooja Dhannawat
2016-03-18 11:51         ` Paolo Bonzini
2016-03-18 13:27           ` Jaya Tiwari
2016-03-18 13:29             ` Jaya Tiwari
2016-03-18 13:49               ` Pooja Dhannawat
2016-03-18 15:14                 ` Paolo Bonzini
2016-03-18 15:58                   ` Pooja Dhannawat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160318093519.GA16661@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=dhannawatpooja1@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).