xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH 1/2] libs/gnttab: do not use alloca(3)
Date: Mon, 22 Aug 2016 10:46:50 +0100	[thread overview]
Message-ID: <57BACA0A.6050807@citrix.com> (raw)
In-Reply-To: <1471444382-30409-2-git-send-email-wei.liu2@citrix.com>

On 17/08/16 15:33, Wei Liu wrote:
> The semantics of alloca(3) is not very nice. If the stack overflows,
> program behaviour is undefined.
> 
> Remove the use of alloca(3) and always use mmap.

This is only using alloca() if the allocation is < PAGE_SIZE.  I think
assuming there's this much extra stack is fine.

Using alloca() avoids the (expensive) mmap() system call.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-22  9:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 14:33 [PATCH 0/2] tools/libs: don't use alloca(3) Wei Liu
2016-08-17 14:33 ` [PATCH 1/2] libs/gnttab: do not " Wei Liu
2016-08-22  9:46   ` David Vrabel [this message]
2016-08-22 10:10     ` Wei Liu
2016-08-22 10:24       ` David Vrabel
2016-08-22 10:44         ` Wei Liu
2016-08-17 14:33 ` [PATCH 2/2] libs/foreignmemory: " Wei Liu
2016-08-17 23:39 ` [PATCH 0/2] tools/libs: don't " Dario Faggioli
2016-08-18  9:29   ` Wei Liu

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=57BACA0A.6050807@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).